1 // Copyright (C) 2014-2021 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
23 #include "Config_def.h"
28 static const char SKETCH_TAB_NAME[] = "Sketch";
32 * \brief Class which describes a one property
39 /// Type of stored property
75 * Creates a one property
76 * \param theSection - name of section (domain of using) of the property.
77 * \param theName - name (title) of the value.
78 * \param theTitle - title of the value
79 * \param theType - type of the value.
80 * \param theDefaultValue - default value of the property. This is an initial property value
82 Config_Prop(const std::string& theSection, const std::string& theName,
83 const std::string& theTitle, PropType theType,
84 const std::string& theDefaultValue,
85 const std::string& theMin, const std::string& theMax)
87 mySection = theSection;
91 myValue = theDefaultValue;
92 myDefaultValue = theDefaultValue;
97 /// Get name of section
98 std::string section() const
102 /// Get name of property
103 std::string name() const
107 /// Get title of property
108 std::string title() const
112 /// Set title of property
113 void setTitle(const std::string& theTitle)
117 /// Get type of property
118 PropType type() const
122 /// Set type of property
123 void setType(PropType theType)
127 /// Get property's value in string format
128 std::string value() const
132 /// Set property's value in string format
133 CONFIG_EXPORT void setValue(const std::string& theValue);
134 /// Get default value of property
135 std::string defaultValue() const
137 return myDefaultValue;
139 /// Set default value of property
140 CONFIG_EXPORT void setDefaultValue(const std::string& theValue);
141 /// Alows to compare Config_Prop with each other
142 bool operator==(const Config_Prop* theProp) const
144 return (mySection == theProp->section()) && (myName == theProp->name());
147 /// Returns minimal value
148 std::string min() const { return myMin; }
150 void setMin(const std::string& theMin) {
154 /// Returns maximal value
155 std::string max() const { return myMax; }
157 void setMax(const std::string& theMax) {
162 std::string mySection; ///< Name of section
163 std::string myName; ///< Name of property
164 std::string myTitle; ///< Title of property
165 PropType myType; ///< Type of property
166 std::string myValue; // Value in string format
167 std::string myDefaultValue; // Default value
168 std::string myMin; // Minimal value
169 std::string myMax; // Maximal value
172 typedef std::list<Config_Prop*> Config_Properties;