00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KPROPERTY_CUSTOMPROPERTY_H
00021 #define KPROPERTY_CUSTOMPROPERTY_H
00022
00023 #include "koproperty_global.h"
00024
00025 class QVariant;
00026
00027 namespace KoProperty {
00028
00029 class Property;
00030
00032
00040 class KOPROPERTY_EXPORT CustomProperty
00041 {
00042 public:
00043 CustomProperty(Property *parent);
00044 virtual ~CustomProperty();
00045
00052 virtual void setValue(const QVariant &value, bool rememberOldValue) = 0;
00053
00057 virtual QVariant value() const = 0;
00058
00063 virtual bool handleValue() const { return false; }
00064
00065 protected:
00066 Property *m_property;
00067
00070 void emitPropertyChanged();
00071 };
00072
00074 class KOPROPERTY_EXPORT SizeCustomProperty : public CustomProperty
00075 {
00076 public:
00077 SizeCustomProperty(Property *parent);
00078 ~SizeCustomProperty();
00079
00080 void setValue(const QVariant &value, bool rememberOldValue);
00081 QVariant value() const;
00082 bool handleValue() const;
00083 };
00084
00086 class KOPROPERTY_EXPORT PointCustomProperty : public CustomProperty
00087 {
00088 public:
00089 PointCustomProperty(Property *parent);
00090 ~PointCustomProperty();
00091
00092 void setValue(const QVariant &value, bool rememberOldValue);
00093 QVariant value() const;
00094 bool handleValue() const;
00095 };
00096
00098 class KOPROPERTY_EXPORT RectCustomProperty : public CustomProperty
00099 {
00100 public:
00101 RectCustomProperty(Property *parent);
00102 ~RectCustomProperty();
00103
00104 void setValue(const QVariant &value, bool rememberOldValue);
00105 QVariant value() const;
00106 bool handleValue() const;
00107 };
00108
00110 class KOPROPERTY_EXPORT SizePolicyCustomProperty : public CustomProperty
00111 {
00112 public:
00113 SizePolicyCustomProperty(Property *parent);
00114 ~SizePolicyCustomProperty();
00115
00116 void setValue(const QVariant &value, bool rememberOldValue);
00117 QVariant value() const;
00118 bool handleValue() const;
00119 };
00120
00121 }
00122
00123 #endif