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< Variant > | getOptionChoices () |
int | getParentItemHashCode () |
Returns the hashcode of the object that owns this property. More... | |
std::vector< te::layout::Property > | getSubProperty () |
EnumType * | getType () |
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< Variant > | m_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::Property > | m_subProperty |
EnumType * | m_type |
data type of this property More... | |
Variant | m_value |
bool | m_visible |
visibility More... | |
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.
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.
|
virtual |
Destructor.
Definition at line 52 of file Property.cpp.
void te::layout::Property::addOption | ( | Variant | variant | ) |
Definition at line 77 of file Property.cpp.
Referenced by te::layout::ScaleModel::getProperties(), te::layout::LegendModel::getProperties(), te::layout::GridMapModel::getProperties(), te::layout::VariantPropertiesBrowser::getProperty(), te::layout::PointModel::pointProperty(), and te::layout::ScaleModel::scaleProperty().
void te::layout::Property::addSubProperty | ( | Property | property | ) |
Definition at line 124 of file Property.cpp.
Referenced by te::layout::TitleModel::getProperties(), and te::layout::JSON::retrieveSubPTree().
void te::layout::Property::clear | ( | ) |
Reset state of this object. Null state.
Definition at line 194 of file Property.cpp.
References te::layout::EnumDataType::getDataTypeNone(), te::layout::Enums::getEnumDataType(), and te::common::Singleton< Enums >::getInstance().
Referenced by te::layout::JSON::retrieve().
|
virtual |
Definition at line 165 of file Property.cpp.
Referenced by te::layout::TextGridSettingsModel::containsOutsideSubProperty(), and te::layout::TitleModel::updateProperties().
|
virtual |
Definition at line 177 of file Property.cpp.
References setName().
|
virtual |
Definition at line 243 of file Property.cpp.
Referenced by te::layout::MenuBuilder::createMenu().
|
virtual |
Returns the label of this property.
Definition at line 223 of file Property.cpp.
Referenced by te::layout::MenuBuilder::createMenu().
std::string te::layout::Property::getName | ( | ) |
Method that returns the name of this property.
Definition at line 57 of file Property.cpp.
Referenced by te::layout::VariantPropertiesBrowser::addProperty(), te::layout::PropertyBrowser::addProperty(), te::layout::DialogPropertiesBrowser::addProperty(), te::layout::TextGridSettingsController::addUpdateProperty(), te::layout::TextGridSettingsController::addUpdateTextGridProperty(), te::layout::PropertiesOutside::changeMapVisitable(), te::layout::PropertiesUtils::checkDynamicProperty(), te::layout::MenuBuilder::createMenu(), te::layout::MenuBuilder::findMnuProperty(), te::layout::JSON::loadFromProperties(), te::layout::DialogPropertiesBrowser::onShowImageDlg(), operator==(), te::layout::PropertyBrowser::removeProperty(), te::layout::PropertiesUtils::sameProperties(), te::layout::JSON::searchProperty(), and te::layout::GridSettingsModel::updateProperty().
te::layout::Variant te::layout::Property::getOptionByCurrentChoice | ( | ) |
Definition at line 104 of file Property.cpp.
Referenced by te::layout::VariantPropertiesBrowser::changeQtVariantPropertyValue(), te::layout::PointModel::updateProperties(), te::layout::ScaleModel::updateProperties(), te::layout::LegendModel::updateProperties(), and te::layout::GridMapModel::updateProperties().
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.
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::EnumType * te::layout::Property::getType | ( | ) |
Returns the type of this property.
Definition at line 67 of file Property.cpp.
Referenced by te::layout::VariantPropertiesBrowser::addProperty(), te::layout::MenuBuilder::changePropertyValue(), te::layout::VariantPropertiesBrowser::changeQtVariantPropertyValue(), te::layout::DialogPropertiesBrowser::checkDlgType(), te::layout::MenuBuilder::createMenu(), te::layout::DialogPropertiesBrowser::findDlgProperty(), te::layout::MenuBuilder::findMnuProperty(), te::layout::DialogPropertiesBrowser::getLayoutType(), te::layout::DialogPropertiesBrowser::getProperty(), te::layout::TextGridSettingsOutside::initCombo(), te::layout::GridSettingsOutside::initCombo(), te::layout::JSON::loadFromProperties(), te::layout::PropertiesOutside::onChangePropertyValue(), te::layout::DialogPropertiesBrowser::onSetDlg(), and te::layout::JSON::searchProperty().
te::layout::Variant te::layout::Property::getValue | ( | ) |
Returns stored value.
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().
|
virtual |
Return 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.
Definition at line 283 of file Property.cpp.
bool te::layout::Property::isEditable | ( | ) |
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().
|
virtual |
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::isNull | ( | ) |
Returns true if no value has been set, false otherwise.
Definition at line 146 of file Property.cpp.
Referenced by te::layout::PropertyBrowser::addSubProperty(), te::layout::TextGridSettingsController::addUpdateTextGridProperty(), te::layout::PropertiesUtils::contains(), te::layout::AbstractBuildGraphicsItem::findCoordinate(), te::layout::AbstractBuildGraphicsItem::findZValue(), te::layout::PointModel::getProperties(), te::layout::ScaleModel::getProperties(), te::layout::ObjectInspectorOutside::onRemoveProperties(), te::layout::PropertyBrowser::propertyEditorValueChanged(), te::layout::LineModel::updateProperties(), te::layout::TitleModel::updateProperties(), te::layout::PointModel::updateProperties(), te::layout::TextModel::updateProperties(), te::layout::ImageModel::updateProperties(), te::layout::ScaleModel::updateProperties(), te::layout::MapModel::updateProperties(), te::layout::LegendModel::updateProperties(), te::layout::GridMapModel::updateProperties(), and te::layout::ItemModelObservable::updateProperties().
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.
Definition at line 293 of file Property.cpp.
bool te::layout::Property::isRequired | ( | ) |
Returns true if property is required, false otherwise.
Definition at line 263 of file Property.cpp.
|
virtual |
Return true if visible, false otherwise.
Definition at line 258 of file Property.cpp.
Referenced by te::layout::MenuBuilder::createMenu(), and te::layout::PropertiesOutside::itemsSelected().
|
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.
true | if 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 | ) |
Sets true if property is editable, false otherwise.
true | if property is editable, false otherwise |
Definition at line 119 of file Property.cpp.
Referenced by te::layout::TextGridSettingsController::addUpdateProperty(), te::layout::TextGridSettingsController::addUpdateTextGridProperty(), te::layout::ObjectInspectorOutside::createProperty(), te::layout::MapModel::getProperties(), and te::layout::ItemModelObservable::getProperties().
|
virtual |
Definition at line 238 of file Property.cpp.
|
virtual |
Sets the label of this property.
label | of 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().
|
virtual |
Sets true if property will be used in a menu, false otherwise.
true | if property will be used in a menu, false otherwise |
Definition at line 228 of file Property.cpp.
Referenced by te::layout::LineModel::getProperties(), te::layout::TitleModel::getProperties(), te::layout::ImageModel::getProperties(), te::layout::TextModel::getProperties(), te::layout::MapModel::getProperties(), te::layout::LegendModel::getProperties(), te::layout::ItemModelObservable::getProperties(), and te::layout::GridMapModel::getProperties().
void te::layout::Property::setName | ( | std::string | name | ) |
Sets the name of this property.
name | of this property |
Definition at line 62 of file Property.cpp.
Referenced by containsSubProperty(), te::layout::ObjectInspectorOutside::createProperty(), te::layout::PageSetupModel::getProperties(), te::layout::SystematicScaleModel::getProperties(), te::layout::TextGridSettingsModel::getProperties(), te::layout::MapLayerChoiceModel::getProperties(), te::layout::LineModel::getProperties(), te::layout::TitleModel::getProperties(), te::layout::ImageModel::getProperties(), te::layout::TextModel::getProperties(), te::layout::MapModel::getProperties(), te::layout::ScaleModel::getProperties(), te::layout::LegendModel::getProperties(), te::layout::ItemModelObservable::getProperties(), te::layout::GridMapModel::getProperties(), te::layout::OutsideModelObservable::getProperties(), te::layout::VariantPropertiesBrowser::getProperty(), te::layout::DialogPropertiesBrowser::getProperty(), te::layout::PointModel::pointProperty(), te::layout::JSON::retrieve(), te::layout::JSON::retrieveSubPTree(), and te::layout::ScaleModel::scaleProperty().
void te::layout::Property::setOptionChoice | ( | Variant | variant | ) |
Definition at line 99 of file Property.cpp.
Referenced by te::layout::VariantPropertiesBrowser::getProperty(), te::layout::PointModel::pointProperty(), and te::layout::ScaleModel::scaleProperty().
void te::layout::Property::setOptionChoice | ( | int | numberOption | ) |
void te::layout::Property::setParentItemHashCode | ( | int | hashCode | ) |
Sets the hashcode of the object that owns this property.
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.
true | if 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.
true | if property is required, false otherwise |
Definition at line 268 of file Property.cpp.
|
inline |
Stores a copy of value.
value | copies the value to be stored |
type | data type |
Definition at line 298 of file Property.h.
References te::layout::Variant::setValue().
Referenced by te::layout::TextGridSettingsController::addUpdateProperty(), te::layout::MenuBuilder::checkedBool(), te::layout::ObjectInspectorOutside::createProperty(), te::layout::DialogPropertiesBrowser::getLayoutType(), te::layout::LineModel::getProperties(), te::layout::TitleModel::getProperties(), te::layout::ImageModel::getProperties(), te::layout::TextModel::getProperties(), te::layout::MapModel::getProperties(), te::layout::ScaleModel::getProperties(), te::layout::LegendModel::getProperties(), te::layout::ItemModelObservable::getProperties(), te::layout::GridMapModel::getProperties(), te::layout::VariantPropertiesBrowser::getProperty(), te::layout::DialogPropertiesBrowser::getProperty(), te::layout::DialogPropertiesBrowser::onShowImageDlg(), te::layout::PointModel::pointProperty(), te::layout::JSON::retrieve(), te::layout::JSON::retrieveSubPTree(), te::layout::ScaleModel::scaleProperty(), and te::layout::GridSettingsController::updateProperty().
void te::layout::Property::setValue | ( | Variant | variant | ) |
Stores a copy of value.
te::layout::Variant | object |
Definition at line 212 of file Property.cpp.
References te::layout::Variant::getType().
|
virtual |
Sets the visibility of this property.
visibility | of this property |
Definition at line 253 of file Property.cpp.
Referenced by te::layout::TextModel::getProperties().
|
protected |
compose widget
Definition at line 293 of file Property.h.
|
protected |
Definition at line 284 of file Property.h.
|
protected |
Definition at line 285 of file Property.h.
|
protected |
Definition at line 290 of file Property.h.
|
protected |
Definition at line 288 of file Property.h.
|
protected |
the property will be used in a menu.
Definition at line 289 of file Property.h.
|
protected |
name of this property
Definition at line 281 of file Property.h.
|
protected |
Definition at line 286 of file Property.h.
|
protected |
hashcode of the object that owns this property
Definition at line 280 of file Property.h.
|
protected |
public property, used by another component
Definition at line 294 of file Property.h.
|
protected |
required
Definition at line 292 of file Property.h.
|
protected |
Definition at line 287 of file Property.h.
|
protected |
|
protected |
Definition at line 283 of file Property.h.
|
protected |
visibility
Definition at line 291 of file Property.h.