Salome HOME
Boolean operations created
[modules/shaper.git] / src / Config / Config_PropManager.h
1 // File:        Config_PropManager.h
2 // Created:     13 Aug 2014
3 // Author:      Vitaly SMETANNIKOV
4
5 #ifndef Config_PropManager_H
6 #define Config_PropManager_H
7
8 #include "Config_def.h"
9 #include "Config_Prop.h"
10
11 #include <map>
12 #include <string>
13 #include <vector>
14
15 //! Class wihich let to register properties
16 class Config_PropManager
17 {
18  public:
19
20   /** 
21    * Registers property parameters
22    * \param theOwnerId - name of owner (name of plugin for example)
23    * \param theSection - name of section (domain of using) of the property.
24    * \param theName - name (title) of the value.
25    * \param theType - type of the value.
26    * \param theValue - initial value of the property
27    * Returns True if the property succesfully registered
28    */
29   CONFIG_EXPORT static bool registerProp(const std::string& theSection, const std::string& theName,
30                            const std::string& theTitle, Config_Prop::PropType theType,
31                            const std::string& theValue);
32
33   CONFIG_EXPORT static Config_Prop* findProp(const std::string& theSection, const std::string& theName);
34
35   CONFIG_EXPORT static Config_Properties getProperties();
36
37   //! Returns list of registered section names.
38   CONFIG_EXPORT static std::list<std::string> getSections();
39
40   //! Returns list of properties by its owner and section.
41   CONFIG_EXPORT static Config_Properties getProperties(const std::string& theSection);
42
43   //! Returns value of the property by its owner, section, and name
44   CONFIG_EXPORT static std::string string(const std::string& theSection, const std::string& theName,
45                             const std::string& theDefault);
46   CONFIG_EXPORT static std::vector<int> color(const std::string& theSection, const std::string& theName,
47                                 const std::string& theDefault);
48   CONFIG_EXPORT static int integer(const std::string& theSection, const std::string& theName,
49                      const std::string& theDefault);
50   CONFIG_EXPORT static double real(const std::string& theSection, const std::string& theName,
51                      const std::string& theDefault);
52
53  private:
54   CONFIG_EXPORT static Config_Properties myProps;
55 };
56
57 #endif