1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
23 #include "Config_def.h"
28 const static char* SKETCH_TAB_NAME = "Sketch";
32 * \brief Class which describes a one property
39 /// Type of stored property
67 * Creates a one property
68 * \param theSection - name of section (domain of using) of the property.
69 * \param theName - name (title) of the value.
70 * \param theTitle - title of the value
71 * \param theType - type of the value.
72 * \param theDefaultValue - default value of the property. This is an initial property value
74 Config_Prop(const std::string& theSection, const std::string& theName,
75 const std::string& theTitle, PropType theType, const std::string& theDefaultValue)
77 mySection = theSection;
81 myValue = theDefaultValue;
82 myDefaultValue = theDefaultValue;
85 /// Get name of section
86 std::string section() const
90 /// Get name of property
91 std::string name() const
95 /// Get title of property
96 std::string title() const
100 /// Set title of property
101 void setTitle(const std::string& theTitle)
105 /// Get type of property
106 PropType type() const
110 /// Set type of property
111 void setType(PropType theType)
115 /// Get property's value in string format
116 std::string value() const
120 /// Set property's value in string format
121 CONFIG_EXPORT void setValue(const std::string& theValue);
122 /// Get default value of property
123 std::string defaultValue() const
125 return myDefaultValue;
127 /// Set default value of property
128 CONFIG_EXPORT void setDefaultValue(const std::string& theValue);
129 /// Alows to compare Config_Prop with each other
130 bool operator==(const Config_Prop* theProp) const
132 return (mySection == theProp->section()) && (myName == theProp->name());
136 std::string mySection; ///< Name of section
137 std::string myName; ///< Name of property
138 std::string myTitle; ///< Title of property
139 PropType myType; ///< Type of property
140 std::string myValue; // Value in string format
141 std::string myDefaultValue; // Default value
144 typedef std::list<Config_Prop*> Config_Properties;