29 #include "../enum/Enums.h"
37 m_parentItemHashCode(parentItemHashCode),
46 m_composeWidget(false),
81 m_currentChoice = variant;
84 m_options.push_back(variant);
89 for(std::vector<Variant>::iterator it = m_options.begin(); it != m_options.end(); it++)
101 m_currentChoice = variant;
106 return m_currentChoice;
121 m_editable = editable;
126 m_subProperty.push_back(property);
131 for(std::vector<Property>::iterator it = m_subProperty.begin(); it != m_subProperty.end(); it++)
133 if((*it) == property)
135 m_subProperty.erase(it);
143 return m_subProperty;
152 if(!m_options.empty())
167 bool is_present =
false;
169 if(std::find(m_subProperty.begin(), m_subProperty.end(), subProperty) != m_subProperty.end())
182 if(std::find(m_subProperty.begin(), m_subProperty.end(), property) != m_subProperty.end())
184 std::vector<Property>::iterator it = std::find(m_subProperty.begin(), m_subProperty.end(), property);
189 property.setName(
"");
202 m_currentChoice.clear();
204 m_subProperty.clear();
208 m_composeWidget =
false;
250 return m_value.isComplex();
270 m_required = required;
275 m_parentItemHashCode = hashCode;
280 return m_parentItemHashCode;
285 return m_composeWidget;
290 m_composeWidget = compose;
304 m_public = publicProperty;
void clear()
Reset state of this object. Null state.
void removeSubProperty(Property property)
std::string getName()
Method that returns the name of this property.
virtual bool isComplex()
Return true if value is not of common C++ data type, false otherwise.
EnumType * getType()
Returns data type of this object.
Variant getValue()
Returns stored value.
virtual EnumDataType * getEnumDataType()
Returns data type enumeration.
void addSubProperty(Property property)
void addOption(Variant variant)
void setPublic(bool publicProperty)
Sets true if property is public, false otherwise If the component, father of this property...
bool isNull()
Returns true if no value has been set, false otherwise.
int getParentItemHashCode()
Returns the hashcode of the object that owns this property.
virtual void setVisible(bool visible)
Sets the visibility of this property.
virtual EnumType * getDataTypeNone() const
Returns value that represents type none belonging to enumeration.
Variant getOptionByCurrentChoice()
void setRequired(bool required)
Sets true if property is required, false otherwise.
virtual bool isMenu()
Returns true if property will be used in a menu, false otherwise.
virtual bool isVisible()
Return true if visible, false otherwise.
static Enums & getInstance()
It returns a reference to the singleton instance.
Class to represent a data type enumeration. Ex.: int, double, bool, te::color::RGBAColor (color)...
Class acts like a union for some C++/TerraLib5 data types. Responsible for storing the value...
virtual void setIcon(std::string icon)
bool isEditable()
Returns true if property is editable, false otherwise.
bool isRequired()
Returns true if property is required, false otherwise.
EnumType * m_type
data type of this property
Property(int parentItemHashCode=0)
Constructor.
virtual std::string getIcon()
void setComposeWidget(bool compose)
Sets true if property compose a widget, false otherwise If true, and the object that owns this proper...
bool isComposeWidget()
Returns true if property compose a widget, false otherwise. If true, and the object that owns this pr...
virtual bool containsSubProperty(Property subProperty)
std::vector< Variant > getOptionChoices()
void setValue(ValueType value, EnumType *type)
Stores a copy of value.
void removeOption(Variant variant)
Class that represents the value of an enumeration. An enumeration is made of "1..n" objects EnumType...
void setEditable(bool editable)
Sets true if property is editable, false otherwise.
void setName(std::string name)
Sets the name of this property.
virtual void setMenu(bool menu)
Sets true if property will be used in a menu, false otherwise.
std::vector< te::layout::Property > getSubProperty()
virtual void setLabel(std::string label)
Sets the label of this property.
EnumType * getType()
Returns the type of this property.
void setOptionChoice(Variant variant)
A property acts like a attribute member of a object and stores the state of this attribute. A set of properties stores the state of an object. Any data type, not included in the convertValue method in the class te::layout::Variant, it will be by default "std::string" value.
bool isPublic()
Returns true if property is public, false otherwise. If the component, father of this property...
virtual ~Property()
Destructor.
void setParentItemHashCode(int hashCode)
Sets the hashcode of the object that owns this property.
virtual std::string getLabel()
Returns the label of this property.