All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
kanzi::Object Class Reference

Object provides metadata and property access to derived classes. More...

#include <kanzi/object/object.hpp>

Inheritance diagram for kanzi::Object:
kanzi::AbstractAnimation kanzi::Action kanzi::Binding kanzi::BindingProcessor kanzi::Brush kanzi::Condition kanzi::InputManipulator kanzi::ListBoxItemContainerGenerator2D kanzi::ListBoxItemContainerGenerator3D kanzi::ListBoxItemGenerator2D kanzi::ListBoxItemGenerator3D kanzi::Node kanzi::Resource kanzi::Timeline kanzi::TimelineClock kanzi::TimelinePlayback kanzi::Trigger

Public Member Functions

 Object (Domain *domain)
 
virtual ~Object ()
 
DomaingetDomain () const
 Returns the domain the object belongs to. More...
 
KzuPropertyManager * getPropertyManager () const
 Returns the property manager of the object. More...
 
KzuTaskSchedulergetTaskScheduler () const
 Returns the task scheduler of the object. More...
 
KzuMessageDispatchergetMessageDispatcher () const
 Returns the message dispatcher of the object. More...
 
ResourceManagergetResourceManager () const
 Returns the resource manager of the object. More...
 
virtual const MetaclassgetDynamicMetaclass () 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...
 
AppliedStyleEntryapplyObjectStyle (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 MetaclassgetStaticMetaclass ()
 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...
 

Detailed Description

Object provides metadata and property access to derived classes.

For explanation of metadata system see #Metaclass

Member Typedef Documentation

Applied style container.

Constructor & Destructor Documentation

kanzi::Object::Object ( Domain domain)
explicit
virtual kanzi::Object::~Object ( )
virtual

Member Function Documentation

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 const Metaclass* kanzi::Object::getStaticMetaclass ( )
static

Returns the metaclass of Object class.

virtual const Metaclass* kanzi::Object::getDynamicMetaclass ( ) const
virtual

Returns the metaclass of the dynamic type of the object.

static PropertyTypeEditorInfoSharedPtr kanzi::Object::makeEditorInfo ( )
static

Default implementation that returns empty editor info.

bool kanzi::Object::isTypeOf ( const Metaclass objectType) const
inline

Determines if the type of this object is the given type or derived from it.

Parameters
objectTypeType to test against.
Returns
True if this object is an instance of objectType.
template<typename DataType >
void kanzi::Object::setProperty ( const PropertyType< DataType > &  propertyType,
typename PropertyType< DataType >::DataType  value 
)
inline

Sets the local value of a property.

Parameters
propertyTypeThe property type identifying the property to set.
valueThe value to set.
void kanzi::Object::setProperty ( const PropertyType< ResourceID > &  propertyType,
ResourceSharedPtr  value 
)
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.

Parameters
propertyTypeThe property type identifying the property to set.
valueThe value to set.
template<typename DataType >
DataType kanzi::Object::getProperty ( const PropertyType< DataType > &  propertyType) const
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:

  1. Local value set with setProperty or loaded from kzb
  2. Value set by a style affecting the property.
  3. Value defined by class metadata.

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.

  1. Values defined is states of state manager.
  2. Animations.

If no inputs to the property value can be established the system returns the value registered in the property type metadata.

Parameters
propertyTypeThe property type identifying the property to retrieve.
Returns
Returns the evaluated property value.
template<typename DataType >
bool kanzi::Object::getProperty ( const PropertyType< DataType > &  propertyType,
typename PropertyType< DataType >::DataType &  value 
) const
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.

Parameters
propertyTypeThe property type identifying the property to retrieve.
valueThe reference that receives the value the function evaluates. The reference is not modified if there are no inputs to the property value.
Returns
Returns true if there are inputs into the property value, false otherwise.
template<typename DataType >
void kanzi::Object::setAbstractProperty ( AbstractPropertyType  abstractPropertyType,
typename PropertyType< DataType >::DataType  value 
)
inline
void kanzi::Object::setAbstractProperty ( AbstractPropertyType  abstractPropertyType,
ResourceSharedPtr  value 
)
inline
template<typename DataType >
DataType kanzi::Object::getAbstractProperty ( AbstractPropertyType  abstractPropertyType) const
inline
template<typename DataType >
bool kanzi::Object::getAbstractProperty ( AbstractPropertyType  abstractPropertyType,
typename PropertyType< DataType >::DataType &  value 
) const
inline
bool kanzi::Object::hasValue ( AbstractPropertyType  propertyType) const

Evaluates whether there are any inputs into the property value.

Parameters
propertyTypeThe property type identifying the property to evaluate.
Returns
Returns true if there are inputs into the property value, false otherwise.
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.

Parameters
propertyTypeThe property type identifying the property to evaluate.
Returns
Returns true if there is a local value for the property.
void kanzi::Object::removeLocalValue ( AbstractPropertyType  propertyType)

Removes the local value associated with the property.

Parameters
propertyTypeThe property type identifying the property to evaluate.
void kanzi::Object::copyLocalValues ( const Object other)

Copies all local values from another object.

Parameters
otherThe object from which to copy the values.
virtual void kanzi::Object::onPropertyChanged ( AbstractPropertyType  propertyType,
KzuPropertyNotificationReason  reason 
)
virtual

Virtual function to handle property change notifications.

Classes deriving from Object can override this function to monitor changes of properties.

Parameters
propertyTypeThe property type identifying the property that has changed.
reasonThe 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.

Returns
A style entry that is used to unapply the style.
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.

void kanzi::Object::initialize ( )
inlineprotected
void kanzi::Object::onCopy ( const Object other)
protected

Member Data Documentation

AppliedStyleContainer kanzi::Object::m_appliedStyles
protected

Listing of applied styles applied to this object.


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