lib

KoProperty::CustomProperty Class Reference

#include <customproperty.h>

Inheritance diagram for KoProperty::CustomProperty:

KoProperty::PointCustomProperty KoProperty::RectCustomProperty KoProperty::SizeCustomProperty KoProperty::SizePolicyCustomProperty List of all members.

Detailed Description

Base class for custom properties.

You will need to subclass CustomProperty to override the behaviour of a property type.
In the constructor, you should create the child properties (if needed). Then, you need to implement the functions concerning values.

Examples of custom properties implementation can be found in customproperty.cpp.

Author:
Cedric Pasteur <cedric.pasteur@free.fr>

Definition at line 40 of file customproperty.h.


Public Member Functions

 CustomProperty (Property *parent)
virtual ~CustomProperty ()
virtual void setValue (const QVariant &value, bool rememberOldValue)=0
virtual QVariant value () const =0
virtual bool handleValue () const

Protected Attributes

Propertym_property

Member Function Documentation

virtual bool KoProperty::CustomProperty::handleValue (  )  const [inline, virtual]

Tells whether CustomProperty should be used to get the property's value. You should return true for child properties, and false for others.

Reimplemented in KoProperty::SizeCustomProperty, KoProperty::PointCustomProperty, KoProperty::RectCustomProperty, and KoProperty::SizePolicyCustomProperty.

Definition at line 61 of file customproperty.h.

virtual void KoProperty::CustomProperty::setValue ( const QVariant &  value,
bool  rememberOldValue 
) [pure virtual]

This function is called by Property::setValue() when a custom property is set. You don't have to modify the property value, it is done by Property class. You just have to update child or parent properties value (m_property->parent()->setValue()). Note that, when calling Property::setValue, you need to set useCustomProperty (3rd parameter) to false, or there will be infinite recursion.

Implemented in KoProperty::SizeCustomProperty, KoProperty::PointCustomProperty, KoProperty::RectCustomProperty, and KoProperty::SizePolicyCustomProperty.

virtual QVariant KoProperty::CustomProperty::value (  )  const [pure virtual]

This function is called by Property::value() when a custom property is set and handleValue() is true. You should return property's value, taken from parent's value.

Implemented in KoProperty::SizeCustomProperty, KoProperty::PointCustomProperty, KoProperty::RectCustomProperty, and KoProperty::SizePolicyCustomProperty.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys