Object provides metadata and property access to derived classes. More...
#include <kanzi/object/object.hpp>
Public Member Functions | |
Object (Domain *domain) | |
virtual | ~Object () |
Domain * | getDomain () const |
Returns the domain the object belongs to. More... | |
KzuPropertyManager * | getPropertyManager () const |
Returns the property manager of the object. More... | |
KzuTaskScheduler * | getTaskScheduler () const |
Returns the task scheduler of the object. More... | |
KzuMessageDispatcher * | getMessageDispatcher () const |
Returns the message dispatcher of the object. More... | |
ResourceManager * | getResourceManager () const |
Returns the resource manager of the object. More... | |
virtual const Metaclass * | getDynamicMetaclass () const |
Returns the metaclass of the dynamic type of the object. More... | |
bool | isTypeOf (const Metaclass *objectType) const |
Determines if the type of this object is the given type or derived from it. More... | |
template<typename DataType > | |
void | setProperty (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::DataType value) |
Sets the local value of a property. More... | |
void | setProperty (const PropertyType< ResourceID > &propertyType, ResourceSharedPtr value) |
Sets the local value of a resource id property with a resource pointer. More... | |
template<typename DataType > | |
DataType | getProperty (const PropertyType< DataType > &propertyType) const |
Returns the current value of a property. More... | |
template<typename DataType > | |
bool | getProperty (const PropertyType< DataType > &propertyType, typename PropertyType< DataType >::DataType &value) const |
Evaluates the property value in the same way as the overload above but does not default to the value in property metadata if there are no inputs to the property value. More... | |
template<typename DataType > | |
void | setAbstractProperty (AbstractPropertyType abstractPropertyType, typename PropertyType< DataType >::DataType value) |
void | setAbstractProperty (AbstractPropertyType abstractPropertyType, ResourceSharedPtr value) |
template<typename DataType > | |
DataType | getAbstractProperty (AbstractPropertyType abstractPropertyType) const |
template<typename DataType > | |
bool | getAbstractProperty (AbstractPropertyType abstractPropertyType, typename PropertyType< DataType >::DataType &value) const |
bool | hasValue (AbstractPropertyType propertyType) const |
Evaluates whether there are any inputs into the property value. More... | |
bool | hasLocalValue (AbstractPropertyType propertyType) const |
Evaluates whether there is a local value set for the property. More... | |
void | removeLocalValue (AbstractPropertyType propertyType) |
Removes the local value associated with the property. More... | |
void | copyLocalValues (const Object &other) |
Copies all local values from another object. More... | |
virtual void | onPropertyChanged (AbstractPropertyType propertyType, KzuPropertyNotificationReason reason) |
Virtual function to handle property change notifications. More... | |
AppliedStyleEntry * | applyObjectStyle (kanzi::StyleSharedPtr style) |
Applies a style to an object. More... | |
void | unapplyObjectStyle (AppliedStyleEntry *appliedStyleEntry) |
void | applyObjectStyles () |
Apply all styles for an object node. More... | |
void | unapplyObjectStyles () |
Unapplies and removes all applied styles. More... | |
Static Public Member Functions | |
static const Metaclass * | getStaticMetaclass () |
Returns the metaclass of Object class. More... | |
static PropertyTypeEditorInfoSharedPtr | makeEditorInfo () |
Default implementation that returns empty editor info. More... | |
Protected Types | |
typedef vector < AppliedStyleEntry * > | AppliedStyleContainer |
Applied style container. More... | |
Protected Member Functions | |
void | initialize () |
void | onCopy (const Object &other) |
Protected Attributes | |
AppliedStyleContainer | m_appliedStyles |
Listing of applied styles applied to this object. More... | |
Object provides metadata and property access to derived classes.
For explanation of metadata system see #Metaclass
|
protected |
Applied style container.
|
explicit |
|
virtual |
Domain* kanzi::Object::getDomain | ( | ) | const |
Returns the domain the object belongs to.
KzuPropertyManager* kanzi::Object::getPropertyManager | ( | ) | const |
Returns the property manager of the object.
KzuTaskScheduler* kanzi::Object::getTaskScheduler | ( | ) | const |
Returns the task scheduler of the object.
KzuMessageDispatcher* kanzi::Object::getMessageDispatcher | ( | ) | const |
Returns the message dispatcher of the object.
ResourceManager* kanzi::Object::getResourceManager | ( | ) | const |
Returns the resource manager of the object.
|
static |
Returns the metaclass of Object class.
|
virtual |
Returns the metaclass of the dynamic type of the object.
|
static |
Default implementation that returns empty editor info.
|
inline |
Determines if the type of this object is the given type or derived from it.
objectType | Type to test against. |
|
inline |
Sets the local value of a property.
propertyType | The property type identifying the property to set. |
value | The value to set. |
|
inline |
Sets the local value of a resource id property with a resource pointer.
The resource id property can be set with either a resource pointer value or with a resource id.
propertyType | The property type identifying the property to set. |
value | The value to set. |
|
inline |
Returns the current value of a property.
The value returned by this function is the result of the property system evaluating the inputs that can affect the values of properties. The final value is calculated by determining the base value of the property and applying existing modifiers to it.
Base value is affected by the following inputs where the highest entry in the list determines the base value:
When the base value is determined the system applies modifiers to the value that can change the value or replace it completely. The following is the list of possible modifiers, where the order of evaluation is determined by the order the modifiers were added or applied.
If no inputs to the property value can be established the system returns the value registered in the property type metadata.
propertyType | The property type identifying the property to retrieve. |
|
inline |
Evaluates the property value in the same way as the overload above but does not default to the value in property metadata if there are no inputs to the property value.
propertyType | The property type identifying the property to retrieve. |
value | The reference that receives the value the function evaluates. The reference is not modified if there are no inputs to the property value. |
|
inline |
|
inline |
|
inline |
|
inline |
bool kanzi::Object::hasValue | ( | AbstractPropertyType | propertyType | ) | const |
Evaluates whether there are any inputs into the property value.
propertyType | The property type identifying the property to evaluate. |
bool kanzi::Object::hasLocalValue | ( | AbstractPropertyType | propertyType | ) | const |
Evaluates whether there is a local value set for the property.
Local values are set with setProperty or loaded from kzb.
propertyType | The property type identifying the property to evaluate. |
void kanzi::Object::removeLocalValue | ( | AbstractPropertyType | propertyType | ) |
Removes the local value associated with the property.
propertyType | The property type identifying the property to evaluate. |
void kanzi::Object::copyLocalValues | ( | const Object & | other | ) |
Copies all local values from another object.
other | The object from which to copy the values. |
|
virtual |
Virtual function to handle property change notifications.
Classes deriving from Object can override this function to monitor changes of properties.
propertyType | The property type identifying the property that has changed. |
reason | The reason that caused the property notification to be invoked. |
Reimplemented in kanzi::Brush, kanzi::TextureBrush, kanzi::MaterialBrush, and kanzi::ColorBrush.
AppliedStyleEntry* kanzi::Object::applyObjectStyle | ( | kanzi::StyleSharedPtr | style | ) |
Applies a style to an object.
void kanzi::Object::unapplyObjectStyle | ( | AppliedStyleEntry * | appliedStyleEntry | ) |
void kanzi::Object::applyObjectStyles | ( | ) |
Apply all styles for an object node.
void kanzi::Object::unapplyObjectStyles | ( | ) |
Unapplies and removes all applied styles.
|
inlineprotected |
|
protected |
|
protected |
Listing of applied styles applied to this object.