All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::layout::Property Class Reference

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. More...

#include <Property.h>

Public Member Functions

void addOption (Variant variant)
 
void addSubProperty (Property property)
 
void clear ()
 Reset state of this object. Null state. More...
 
virtual bool containsSubProperty (Property subProperty)
 
virtual Property containsSubProperty (std::string name)
 
virtual std::string getIcon ()
 
virtual std::string getLabel ()
 Returns the label of this property. More...
 
std::string getName ()
 Method that returns the name of this property. More...
 
Variant getOptionByCurrentChoice ()
 
std::vector< VariantgetOptionChoices ()
 
int getParentItemHashCode ()
 Returns the hashcode of the object that owns this property. More...
 
std::vector< te::layout::PropertygetSubProperty ()
 
EnumTypegetType ()
 Returns the type of this property. More...
 
Variant getValue ()
 Returns stored value. More...
 
virtual bool isComplex ()
 Return true if value is not of common C++ data type, false otherwise. More...
 
bool isComposeWidget ()
 Returns true if property compose a widget, false otherwise. If true, and the object that owns this property has a parent, it will not appear in a property browser or a menu, it will be used within a widget. More...
 
bool isEditable ()
 Returns true if property is editable, false otherwise. More...
 
virtual bool isMenu ()
 Returns true if property will be used in a menu, false otherwise. More...
 
bool isNull ()
 Returns true if no value has been set, false otherwise. More...
 
bool isPublic ()
 Returns true if property is public, false otherwise. If the component, father of this property, is a child of another component, then this property can be used by the parent component to display the value or call windows. It can not be edited. More...
 
bool isRequired ()
 Returns true if property is required, false otherwise. More...
 
virtual bool isVisible ()
 Return true if visible, false otherwise. More...
 
bool operator== (const Property &other)
 
 Property (int parentItemHashCode=0)
 Constructor. More...
 
void removeOption (Variant variant)
 
void removeSubProperty (Property property)
 
void setComposeWidget (bool compose)
 Sets true if property compose a widget, false otherwise If true, and the object that owns this property has a parent, it will not appear in a property browser or a menu, it will be used within a widget. More...
 
void setEditable (bool editable)
 Sets true if property is editable, false otherwise. More...
 
virtual void setIcon (std::string icon)
 
virtual void setLabel (std::string label)
 Sets the label of this property. More...
 
virtual void setMenu (bool menu)
 Sets true if property will be used in a menu, false otherwise. More...
 
void setName (std::string name)
 Sets the name of this property. More...
 
void setOptionChoice (Variant variant)
 
void setOptionChoice (int numberOption)
 
void setParentItemHashCode (int hashCode)
 Sets the hashcode of the object that owns this property. More...
 
void setPublic (bool publicProperty)
 Sets true if property is public, false otherwise If the component, father of this property, is a child of another component, then this property can be used by the parent component to display the value or call windows. It can not be edited. More...
 
void setRequired (bool required)
 Sets true if property is required, false otherwise. More...
 
template<typename ValueType >
void setValue (ValueType value, EnumType *type)
 Stores a copy of value. More...
 
void setValue (Variant variant)
 Stores a copy of value. More...
 
virtual void setVisible (bool visible)
 Sets the visibility of this property. More...
 
virtual ~Property ()
 Destructor. More...
 

Protected Attributes

bool m_composeWidget
 compose widget More...
 
Variant m_currentChoice
 
bool m_editable
 
std::string m_icon
 
std::string m_label
 
bool m_menu
 the property will be used in a menu. More...
 
std::string m_name
 name of this property More...
 
std::vector< Variantm_options
 
int m_parentItemHashCode
 hashcode of the object that owns this property More...
 
bool m_public
 public property, used by another component More...
 
bool m_required
 required More...
 
std::vector< te::layout::Propertym_subProperty
 
EnumTypem_type
 data type of this property More...
 
Variant m_value
 
bool m_visible
 visibility More...
 

Detailed Description

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.

Definition at line 47 of file Property.h.

Constructor & Destructor Documentation

te::layout::Property::Property ( int  parentItemHashCode = 0)

Constructor.

Definition at line 36 of file Property.cpp.

References te::common::Singleton< Enums >::getInstance(), and m_type.

te::layout::Property::~Property ( )
virtual

Destructor.

Definition at line 52 of file Property.cpp.

Member Function Documentation

void te::layout::Property::addSubProperty ( Property  property)
void te::layout::Property::clear ( )
bool te::layout::Property::containsSubProperty ( Property  subProperty)
virtual
te::layout::Property te::layout::Property::containsSubProperty ( std::string  name)
virtual

Definition at line 177 of file Property.cpp.

References setName().

std::string te::layout::Property::getIcon ( )
virtual

Definition at line 243 of file Property.cpp.

Referenced by te::layout::MenuBuilder::createMenu().

std::string te::layout::Property::getLabel ( )
virtual

Returns the label of this property.

Returns
label of this property

Definition at line 223 of file Property.cpp.

Referenced by te::layout::MenuBuilder::createMenu().

std::vector< te::layout::Variant > te::layout::Property::getOptionChoices ( )

Definition at line 109 of file Property.cpp.

int te::layout::Property::getParentItemHashCode ( )

Returns the hashcode of the object that owns this property.

Returns
hashcode

Definition at line 278 of file Property.cpp.

Referenced by te::layout::PropertiesUtils::equalsHashCode(), te::layout::PropertiesOutside::onChangePropertyValue(), and te::layout::ItemModelObservable::updateChildrenProperties().

std::vector< te::layout::Property > te::layout::Property::getSubProperty ( )

Definition at line 141 of file Property.cpp.

Referenced by te::layout::JSON::searchProperty().

te::layout::Variant te::layout::Property::getValue ( )

Returns stored value.

Returns
te::layout::Variant object

Definition at line 72 of file Property.cpp.

Referenced by te::layout::DialogPropertiesBrowser::addProperty(), te::layout::TextGridSettingsController::addUpdateProperty(), te::layout::TextGridSettingsController::addUpdateTextGridProperty(), te::layout::VariantPropertiesBrowser::changeQtVariantPropertyValue(), te::layout::MenuBuilder::createMenu(), te::layout::ChangePropertyCommand::equals(), te::layout::AbstractBuildGraphicsItem::findCoordinate(), te::layout::AbstractBuildGraphicsItem::findZValue(), te::layout::DialogPropertiesBrowser::getLayoutType(), te::layout::TextGridSettingsOutside::initBool(), te::layout::GridSettingsOutside::initBool(), te::layout::TextGridSettingsOutside::initColor(), te::layout::GridSettingsOutside::initColor(), te::layout::TextGridSettingsOutside::initCombo(), te::layout::GridSettingsOutside::initCombo(), te::layout::TextGridSettingsOutside::initDouble(), te::layout::GridSettingsOutside::initDouble(), te::layout::TextGridSettingsOutside::initInt(), te::layout::GridSettingsOutside::initInt(), te::layout::TextGridSettingsOutside::initString(), te::layout::GridSettingsOutside::initString(), te::layout::JSON::loadFromProperties(), te::layout::JSON::searchProperty(), te::layout::LineModel::updateProperties(), te::layout::TitleModel::updateProperties(), te::layout::TextModel::updateProperties(), te::layout::ImageModel::updateProperties(), te::layout::MapModel::updateProperties(), te::layout::ScaleModel::updateProperties(), te::layout::LegendModel::updateProperties(), te::layout::GridMapModel::updateProperties(), and te::layout::ItemModelObservable::updateProperties().

bool te::layout::Property::isComplex ( )
virtual

Return true if value is not of common C++ data type, false otherwise.

Returns
true if value is not of common C++ data type, false otherwise

Definition at line 248 of file Property.cpp.

bool te::layout::Property::isComposeWidget ( )

Returns true if property compose a widget, false otherwise. If true, and the object that owns this property has a parent, it will not appear in a property browser or a menu, it will be used within a widget.

Returns
true if property compose a widget, false otherwise

Definition at line 283 of file Property.cpp.

bool te::layout::Property::isEditable ( )

Returns true if property is editable, false otherwise.

Returns
true if property is editable, false otherwise

Definition at line 114 of file Property.cpp.

Referenced by te::layout::TextGridSettingsController::addUpdateProperty(), and te::layout::TextGridSettingsController::addUpdateTextGridProperty().

bool te::layout::Property::isMenu ( )
virtual

Returns true if property will be used in a menu, false otherwise.

Returns
true if property will be used in a menu, false otherwise

Definition at line 233 of file Property.cpp.

Referenced by te::layout::MenuBuilder::createMenu(), and te::layout::PropertiesOutside::itemsSelected().

bool te::layout::Property::isPublic ( )

Returns true if property is public, false otherwise. If the component, father of this property, is a child of another component, then this property can be used by the parent component to display the value or call windows. It can not be edited.

Returns
true if property compose a widget, false otherwise

Definition at line 293 of file Property.cpp.

bool te::layout::Property::isRequired ( )

Returns true if property is required, false otherwise.

Returns
true if property is required, false otherwise

Definition at line 263 of file Property.cpp.

bool te::layout::Property::isVisible ( )
virtual

Return true if visible, false otherwise.

Returns
true if visible, false otherwise

Definition at line 258 of file Property.cpp.

Referenced by te::layout::MenuBuilder::createMenu(), and te::layout::PropertiesOutside::itemsSelected().

bool te::layout::Property::operator== ( const Property other)
inline

Definition at line 307 of file Property.h.

References getName().

void te::layout::Property::removeOption ( Variant  variant)

Definition at line 87 of file Property.cpp.

void te::layout::Property::removeSubProperty ( Property  property)

Definition at line 129 of file Property.cpp.

void te::layout::Property::setComposeWidget ( bool  compose)

Sets true if property compose a widget, false otherwise If true, and the object that owns this property has a parent, it will not appear in a property browser or a menu, it will be used within a widget.

Parameters
trueif property compose a widget, false otherwise

Definition at line 288 of file Property.cpp.

Referenced by te::layout::GridMapModel::getProperties().

void te::layout::Property::setEditable ( bool  editable)
void te::layout::Property::setIcon ( std::string  icon)
virtual

Definition at line 238 of file Property.cpp.

void te::layout::Property::setLabel ( std::string  label)
virtual

Sets the label of this property.

Parameters
labelof this property

Definition at line 218 of file Property.cpp.

Referenced by te::layout::LineModel::getProperties(), te::layout::PointModel::pointProperty(), and te::layout::ScaleModel::scaleProperty().

void te::layout::Property::setMenu ( bool  menu)
virtual
void te::layout::Property::setOptionChoice ( Variant  variant)
void te::layout::Property::setOptionChoice ( int  numberOption)
void te::layout::Property::setParentItemHashCode ( int  hashCode)

Sets the hashcode of the object that owns this property.

Parameters
hashcode

Definition at line 273 of file Property.cpp.

Referenced by te::layout::PropertiesUtils::sameProperties().

void te::layout::Property::setPublic ( bool  publicProperty)

Sets true if property is public, false otherwise If the component, father of this property, is a child of another component, then this property can be used by the parent component to display the value or call windows. It can not be edited.

Parameters
trueif property compose a widget, false otherwise

Definition at line 298 of file Property.cpp.

Referenced by te::layout::GridMapModel::getProperties().

void te::layout::Property::setRequired ( bool  required)

Sets true if property is required, false otherwise.

Parameters
trueif property is required, false otherwise

Definition at line 268 of file Property.cpp.

void te::layout::Property::setValue ( Variant  variant)

Stores a copy of value.

Parameters
te::layout::Variantobject

Definition at line 212 of file Property.cpp.

References te::layout::Variant::getType().

void te::layout::Property::setVisible ( bool  visible)
virtual

Sets the visibility of this property.

Parameters
visibilityof this property

Definition at line 253 of file Property.cpp.

Referenced by te::layout::TextModel::getProperties().

Member Data Documentation

bool te::layout::Property::m_composeWidget
protected

compose widget

Definition at line 293 of file Property.h.

Variant te::layout::Property::m_currentChoice
protected

Definition at line 284 of file Property.h.

bool te::layout::Property::m_editable
protected

Definition at line 285 of file Property.h.

std::string te::layout::Property::m_icon
protected

Definition at line 290 of file Property.h.

std::string te::layout::Property::m_label
protected

Definition at line 288 of file Property.h.

bool te::layout::Property::m_menu
protected

the property will be used in a menu.

Definition at line 289 of file Property.h.

std::string te::layout::Property::m_name
protected

name of this property

Definition at line 281 of file Property.h.

std::vector<Variant> te::layout::Property::m_options
protected

Definition at line 286 of file Property.h.

int te::layout::Property::m_parentItemHashCode
protected

hashcode of the object that owns this property

Definition at line 280 of file Property.h.

bool te::layout::Property::m_public
protected

public property, used by another component

Definition at line 294 of file Property.h.

bool te::layout::Property::m_required
protected

required

Definition at line 292 of file Property.h.

std::vector<te::layout::Property> te::layout::Property::m_subProperty
protected

Definition at line 287 of file Property.h.

EnumType* te::layout::Property::m_type
protected

data type of this property

Definition at line 282 of file Property.h.

Referenced by Property().

Variant te::layout::Property::m_value
protected

Definition at line 283 of file Property.h.

bool te::layout::Property::m_visible
protected

visibility

Definition at line 291 of file Property.h.


The documentation for this class was generated from the following files: