lib

customproperty.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
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 
00061         virtual bool handleValue() const { return false; }
00062 
00063     protected:
00064         Property  *m_property;
00065 };
00066 
00068 class KOPROPERTY_EXPORT SizeCustomProperty : public CustomProperty
00069 {
00070     public:
00071         SizeCustomProperty(Property *parent);
00072         ~SizeCustomProperty();
00073 
00074         void setValue(const QVariant &value, bool rememberOldValue);
00075         QVariant value() const;
00076         bool handleValue() const;
00077 };
00078 
00080 class KOPROPERTY_EXPORT PointCustomProperty : public CustomProperty
00081 {
00082     public:
00083         PointCustomProperty(Property *parent);
00084         ~PointCustomProperty();
00085 
00086         void setValue(const QVariant &value, bool rememberOldValue);
00087         QVariant value() const;
00088         bool handleValue() const;
00089 };
00090 
00092 class KOPROPERTY_EXPORT RectCustomProperty : public CustomProperty
00093 {
00094     public:
00095         RectCustomProperty(Property *parent);
00096         ~RectCustomProperty();
00097 
00098         void setValue(const QVariant &value, bool rememberOldValue);
00099         QVariant value() const;
00100         bool handleValue() const;
00101 };
00102 
00104 class KOPROPERTY_EXPORT SizePolicyCustomProperty : public CustomProperty
00105 {
00106     public:
00107         SizePolicyCustomProperty(Property *parent);
00108         ~SizePolicyCustomProperty();
00109 
00110         void setValue(const QVariant &value, bool rememberOldValue);
00111         QVariant value() const;
00112         bool handleValue() const;
00113 };
00114 
00115 }
00116 
00117 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys