X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConfig%2FConfig_Prop.h;h=5e6cc4bc8576045bef9023694e7966a1c3121254;hb=5090ea57c88f874ec211b5addb28e413db5eb68e;hp=f74137c3c7ab125e0cb7ed84eaa024ae9442e563;hpb=8dc74f82810d5f597b78633b457efb0ef4f89f9f;p=modules%2Fshaper.git diff --git a/src/Config/Config_Prop.h b/src/Config/Config_Prop.h index f74137c3c..5e6cc4bc8 100644 --- a/src/Config/Config_Prop.h +++ b/src/Config/Config_Prop.h @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: Config_Prop.h // Created: 12 Aug 2014 // Author: Vitaly SMETANNIKOV @@ -10,11 +12,16 @@ #include #include -/// Class which describes a one property +/*! + * \class Config_Prop + * \brief Class which describes a one property + * \ingroup Config + */ class Config_Prop { public: + /// Type of stored property enum PropType { Disabled, @@ -37,73 +44,86 @@ class Config_Prop Shortcut, ShortcutTree, BiColor, - Background + Background, + Directory }; /** * Creates a one property * \param theSection - name of section (domain of using) of the property. * \param theName - name (title) of the value. + * \param theTitle - title of the value * \param theType - type of the value. - * \param theValue - initial value of the property. + * \param theDefaultValue - default value of the property. This is an initial property value */ Config_Prop(const std::string& theSection, const std::string& theName, - const std::string& theTitle, PropType theType, const std::string& theValue) + const std::string& theTitle, PropType theType, const std::string& theDefaultValue) { mySection = theSection; myName = theName; myTitle = theTitle; myType = theType; - myValue = theValue; + myValue = theDefaultValue; + myDefaultValue = theDefaultValue; } + /// Get name of section std::string section() const { return mySection; } + /// Get name of property std::string name() const { return myName; } - + /// Get title of property std::string title() const { return myTitle; } + /// Set title of property void setTitle(const std::string& theTitle) { myTitle = theTitle; } - + /// Get type of property PropType type() const { return myType; } + /// Set type of property void setType(PropType theType) { myType = theType; } - + /// Get property's value in string format std::string value() const { return myValue; } - void setValue(const std::string& theValue) + /// Set property's value in string format + CONFIG_EXPORT void setValue(const std::string& theValue); + /// Get default value of property + std::string defaultValue() const { - myValue = theValue; + return myDefaultValue; } - + /// Set default value of property + CONFIG_EXPORT void setDefaultValue(const std::string& theValue); + /// Alows to compare Config_Prop with each other bool operator==(const Config_Prop* theProp) const { return (mySection == theProp->section()) && (myName == theProp->name()); } private: - std::string mySection; - std::string myName; - std::string myTitle; - PropType myType; - std::string myValue; + std::string mySection; ///< Name of section + std::string myName; ///< Name of property + std::string myTitle; ///< Title of property + PropType myType; ///< Type of property + std::string myValue; // Value in string format + std::string myDefaultValue; // Default value }; typedef std::list Config_Properties;