OpenLexocad
27.1
|
#include <DynamicProperty.h>
Classes | |
struct | PropData |
Public Member Functions | |
DynamicProperty () | |
virtual | ~DynamicProperty () |
void | clear () |
Remove all properties. More... | |
size_t | size () const |
Get property count. More... | |
void | save (const Property *prop, Base::AbstractWriter &writer, Base::PersistenceVersion &version) |
Property * | restore (PropertyContainer &pc, const char *PropName, const char *TypeName, Base::AbstractXMLReader &reader, Base::PersistenceVersion &version) |
PropData | getDynamicPropertyData (const Property *prop) const |
Access properties | |
void | getPropertyList (std::vector< Property * > &List) const |
Get all properties of the class (including parent) More... | |
void | getPropertyMap (std::map< std::string, Property * > &Map) const |
Get all properties of the class (including parent) More... | |
Property * | getDynamicPropertyByName (const char *name) const |
Find a dynamic property by its name. More... | |
Property * | addDynamicProperty (PropertyContainer &pc, const char *type, const char *name=0, const char *group=0, const char *doc=0, short attr=0, bool ro=false, bool hidden=false) |
bool | addProperty (Property *prop) |
bool | removeDynamicProperty (const char *name) |
bool | removeProperty (const Property *prop) |
Remove pre-existing property, which will not be deleted. More... | |
std::vector< std::string > | getDynamicPropertyNames () const |
Get a list of all dynamic properties. More... | |
const char * | getPropertyName (const Property *prop) const |
Get the name of a property. More... | |
Property attributes | |
short | getPropertyType (const Property *prop) const |
Get the attributes of a property. More... | |
short | getPropertyType (const char *name) const |
Get the attributes of a named property. More... | |
const char * | getPropertyGroup (const Property *prop) const |
Get the group name of a property. More... | |
const char * | getPropertyGroup (const char *name) const |
Get the group name of a named property. More... | |
const char * | getPropertyDocumentation (const Property *prop) const |
Get the documentation of a property. More... | |
const char * | getPropertyDocumentation (const char *name) const |
Get the documentation of a named property. More... | |
This class implements an interface to add properties at run-time to an object derived from PropertyContainer. The additional properties are made persistent.
Core::DynamicProperty::DynamicProperty | ( | ) |
|
virtual |
Property* Core::DynamicProperty::addDynamicProperty | ( | PropertyContainer & | pc, |
const char * | type, | ||
const char * | name = 0 , |
||
const char * | group = 0 , |
||
const char * | doc = 0 , |
||
short | attr = 0 , |
||
bool | ro = false , |
||
bool | hidden = false |
||
) |
Add a dynamic property of the type type and with the name name. Group gives the grouping name which appears in the property editor and doc shows the tooltip there. With attr, ro and hidden the behaviour of the property can be controlled. attr is an OR'ed value of the PropertyType enumeration. If no special attribute should be set Prop_None can be set (or leave the default of 0). For convenience the attributes for 'Read-Only' and 'Hidden' can also be controlled with the values ro or hidden. This means,
is equivalent to
bool Core::DynamicProperty::addProperty | ( | Property * | prop | ) |
Add a pre-existing property
The property is not treated as dynamic, and will not trigger signal.
void Core::DynamicProperty::clear | ( | ) |
Remove all properties.
Property* Core::DynamicProperty::getDynamicPropertyByName | ( | const char * | name | ) | const |
Find a dynamic property by its name.
std::vector<std::string> Core::DynamicProperty::getDynamicPropertyNames | ( | ) | const |
Get a list of all dynamic properties.
const char* Core::DynamicProperty::getPropertyDocumentation | ( | const Property * | prop | ) | const |
Get the documentation of a property.
const char* Core::DynamicProperty::getPropertyDocumentation | ( | const char * | name | ) | const |
Get the documentation of a named property.
const char* Core::DynamicProperty::getPropertyGroup | ( | const Property * | prop | ) | const |
Get the group name of a property.
const char* Core::DynamicProperty::getPropertyGroup | ( | const char * | name | ) | const |
Get the group name of a named property.
void Core::DynamicProperty::getPropertyList | ( | std::vector< Property * > & | List | ) | const |
Get all properties of the class (including parent)
void Core::DynamicProperty::getPropertyMap | ( | std::map< std::string, Property * > & | Map | ) | const |
Get all properties of the class (including parent)
const char* Core::DynamicProperty::getPropertyName | ( | const Property * | prop | ) | const |
Get the name of a property.
short Core::DynamicProperty::getPropertyType | ( | const Property * | prop | ) | const |
Get the attributes of a property.
short Core::DynamicProperty::getPropertyType | ( | const char * | name | ) | const |
Get the attributes of a named property.
bool Core::DynamicProperty::removeDynamicProperty | ( | const char * | name | ) |
Removes a dynamic property by name. Returns true if the property is part of the container, otherwise false is returned.
bool Core::DynamicProperty::removeProperty | ( | const Property * | prop | ) |
Remove pre-existing property, which will not be deleted.
Property* Core::DynamicProperty::restore | ( | PropertyContainer & | pc, |
const char * | PropName, | ||
const char * | TypeName, | ||
Base::AbstractXMLReader & | reader, | ||
Base::PersistenceVersion & | version | ||
) |
void Core::DynamicProperty::save | ( | const Property * | prop, |
Base::AbstractWriter & | writer, | ||
Base::PersistenceVersion & | version | ||
) |
size_t Core::DynamicProperty::size | ( | ) | const |
Get property count.