lib

customproperty.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KPROPERTY_CUSTOMPROPERTY_H
21#define KPROPERTY_CUSTOMPROPERTY_H
22
23#include "koproperty_global.h"
24
25class TQVariant;
26
27namespace KoProperty {
28
29class Property;
30
32
40class KOPROPERTY_EXPORT CustomProperty
41{
42 public:
43 CustomProperty(Property *parent);
44 virtual ~CustomProperty();
45
52 virtual void setValue(const TQVariant &value, bool rememberOldValue) = 0;
53
57 virtual TQVariant value() const = 0;
58
63 virtual bool handleValue() const { return false; }
64
65 protected:
66 Property *m_property;
67
70 void emitPropertyChanged();
71};
72
74class KOPROPERTY_EXPORT SizeCustomProperty : public CustomProperty
75{
76 public:
77 SizeCustomProperty(Property *parent);
78 ~SizeCustomProperty();
79
80 void setValue(const TQVariant &value, bool rememberOldValue);
81 TQVariant value() const;
82 bool handleValue() const;
83};
84
86class KOPROPERTY_EXPORT PointCustomProperty : public CustomProperty
87{
88 public:
89 PointCustomProperty(Property *parent);
90 ~PointCustomProperty();
91
92 void setValue(const TQVariant &value, bool rememberOldValue);
93 TQVariant value() const;
94 bool handleValue() const;
95};
96
98class KOPROPERTY_EXPORT RectCustomProperty : public CustomProperty
99{
100 public:
101 RectCustomProperty(Property *parent);
102 ~RectCustomProperty();
103
104 void setValue(const TQVariant &value, bool rememberOldValue);
105 TQVariant value() const;
106 bool handleValue() const;
107};
108
110class KOPROPERTY_EXPORT SizePolicyCustomProperty : public CustomProperty
111{
112 public:
113 SizePolicyCustomProperty(Property *parent);
114 ~SizePolicyCustomProperty();
115
116 void setValue(const TQVariant &value, bool rememberOldValue);
117 TQVariant value() const;
118 bool handleValue() const;
119};
120
121}
122
123#endif
virtual void setValue(const TQVariant &value, bool rememberOldValue)=0
virtual TQVariant value() const =0
virtual bool handleValue() const
void setValue(const TQVariant &value, bool rememberOldValue)
The base class representing a single property.
Definition property.h:177
void setValue(const TQVariant &value, bool rememberOldValue)
void setValue(const TQVariant &value, bool rememberOldValue)
void setValue(const TQVariant &value, bool rememberOldValue)
Namespace for a set of classes implementing generic properties framework.