Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
FIx for issue #360 : make switching on/off checking of transactions in Session -...
[modules/shaper.git]
/
src
/
Config
/
Config_Prop.h
diff --git
a/src/Config/Config_Prop.h
b/src/Config/Config_Prop.h
index 246df80748f82e0882f6a9ef3a7fbd17d1cc6c02..b9252a8c0b3bd8138aaa0806942e807c3cea5a6d 100644
(file)
--- 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
// File: Config_Prop.h
// Created: 12 Aug 2014
// Author: Vitaly SMETANNIKOV
@@
-13,58
+15,107
@@
/// Class which describes a one property
class Config_Prop
{
/// Class which describes a one property
class Config_Prop
{
-public:
-
- enum PropType { Disabled, Space, Bool, Color, String, Selector,
- DblSpin, IntSpin, Double, Integer,
- GroupBox, Tab, Frame, Font, DirList, File,
- Slider, Shortcut, ShortcutTree, BiColor, Background };
+ public:
+ enum PropType
+ {
+ Disabled,
+ Space,
+ Bool,
+ Color,
+ String,
+ Selector,
+ DblSpin,
+ IntSpin,
+ Double,
+ Integer,
+ GroupBox,
+ Tab,
+ Frame,
+ Font,
+ DirList,
+ File,
+ Slider,
+ Shortcut,
+ ShortcutTree,
+ BiColor,
+ 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 theType - type of the value.
- * \param theValue - initial value of the property.
- */
- Config_Prop(const std::string& theSection,
- const std::string& theName,
- const std::string& theTitle,
- PropType theType,
- const std::string& theValue ) {
+ * Creates a one property
+ * \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 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& theDefaultValue)
+ {
mySection = theSection;
myName = theName;
myTitle = theTitle;
myType = theType;
mySection = theSection;
myName = theName;
myTitle = theTitle;
myType = theType;
- myValue = theValue;
+ myValue = theDefaultValue;
+ myDefaultValue = theDefaultValue;
+ }
+
+ std::string section() const
+ {
+ return mySection;
+ }
+ std::string name() const
+ {
+ return myName;
+ }
+
+ std::string title() const
+ {
+ return myTitle;
+ }
+ void setTitle(const std::string& theTitle)
+ {
+ myTitle = theTitle;
}
}
- std::string section() const { return mySection; }
- std::string name() const { return myName; }
+ PropType type() const
+ {
+ return myType;
+ }
+ void setType(PropType theType)
+ {
+ myType = theType;
+ }
- std::string title() const { return myTitle; }
- void setTitle(const std::string& theTitle) { myTitle = theTitle; }
+ std::string value() const
+ {
+ return myValue;
+ }
- PropType type() const { return myType; }
- void setType(PropType theType) { myType = theType; }
+ CONFIG_EXPORT void setValue(const std::string& theValue);
+
+ std::string defaultValue() const
+ {
+ return myDefaultValue;
+ }
- std::string value() const { return myValue; }
- void setValue(const std::string& theValue) { myValue = theValue; }
+ CONFIG_EXPORT void setDefaultValue(const std::string& theValue);
bool operator==(const Config_Prop* theProp) const
{
return (mySection == theProp->section()) && (myName == theProp->name());
}
bool operator==(const Config_Prop* theProp) const
{
return (mySection == theProp->section()) && (myName == theProp->name());
}
-private:
+
private:
std::string mySection;
std::string myName;
std::string myTitle;
PropType myType;
std::string myValue;
std::string mySection;
std::string myName;
std::string myTitle;
PropType myType;
std::string myValue;
+ std::string myDefaultValue;
};
typedef std::list<Config_Prop*> Config_Properties;
};
typedef std::list<Config_Prop*> Config_Properties;
-#endif
\ No newline at end of file
+#endif