X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConfig%2FConfig_PropManager.h;h=496cddd6dce8e9017b095168dca77639bb39fdec;hb=e30796dab1aa68c01201b2b89d4292d3fcbbc4d4;hp=4a6d43226a5f1ea9246847c130cfa6f60bff57ae;hpb=e8f6a194e38ff95708bf0984081d9f4e7d9ab115;p=modules%2Fshaper.git diff --git a/src/Config/Config_PropManager.h b/src/Config/Config_PropManager.h index 4a6d43226..496cddd6d 100644 --- a/src/Config/Config_PropManager.h +++ b/src/Config/Config_PropManager.h @@ -13,59 +13,48 @@ #include //! Class wihich let to register properties -class CONFIG_EXPORT Config_PropManager +class Config_PropManager { -public: + public: /** - * Registers property parameters - * \param theOwnerId - name of owner (name of plugin for example) - * \param theSection - name of section (domain of using) of the property. - * \param theName - name (title) of the value. - * \param theType - type of the value. - * \param theValue - initial value of the property - * Returns True if the property succesfully registered - */ - static bool registerProp(const std::string& theOwnerId, - const std::string& theSection, - const std::string& theName, - const std::string& theTitle, - Config_Prop::PropType theType, - const std::string& theValue); - - //! Returns list of registered owners. - static std::list getOwners(); - - //! Returns list of properties by its owner. - static Config_Properties getProperties(const std::string& theOwnerId); + * Registers property parameters + * \param theOwnerId - name of owner (name of plugin for example) + * \param theSection - name of section (domain of using) of the property. + * \param theName - name (title) of the value. + * \param theType - type of the value. + * \param theValue - initial value of the property + * Returns True if the property succesfully registered + */ + CONFIG_EXPORT static bool registerProp(const std::string& theSection, const std::string& theName, + const std::string& theTitle, Config_Prop::PropType theType, const std::string& theValue); + + CONFIG_EXPORT static Config_Prop* findProp( + const std::string& theSection, const std::string& theName); + + CONFIG_EXPORT static Config_Properties getProperties(); //! Returns list of registered section names. - static std::list getSections(const std::string& theOwnerId); + CONFIG_EXPORT static std::list getSections(); //! Returns list of properties by its owner and section. - static Config_Properties getProperties(const std::string& theOwnerId, const std::string& theSection); + CONFIG_EXPORT static Config_Properties getProperties(const std::string& theSection); //! Returns value of the property by its owner, section, and name - static std::string value(const std::string& theOwnerId, - const std::string& theSection, - const std::string& theName, - const std::string& theDefault); - -private: - - /** - * Registers property parameters - * \param theOwnerId - name of owner (name of plugin for example) - * \param theProp - the Property object. - * Returns True if the property succesfully registered - */ - static bool registerProp(const std::string& theOwnerId, - Config_Prop* theProp); - - static std::map myPropMap; + CONFIG_EXPORT static std::string string( + const std::string& theSection, const std::string& theName, const std::string& theDefault); + + CONFIG_EXPORT static std::vector color( + const std::string& theSection, const std::string& theName, const std::string& theDefault); + + CONFIG_EXPORT static int integer( + const std::string& theSection, const std::string& theName, const std::string& theDefault); + + CONFIG_EXPORT static double real( + const std::string& theSection, const std::string& theName, const std::string& theDefault); + + private: + CONFIG_EXPORT static Config_Properties myProps; }; - -CONFIG_EXPORT std::vector stringToRGB(const std::string& theColor); - -#endif \ No newline at end of file +#endif