F:/KPlato/koffice/libs/koproperty/editors/booledit.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
00003    Copyright (C) 2004 Alexander Dymo <cloudtemple@mskat.net>
00004    Copyright (C) 2006 Jaroslaw Staniek <js@iidea.pl>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef KPROPERTY_BOOLEDIT_H
00023 #define KPROPERTY_BOOLEDIT_H
00024 
00025 #include "../widget.h"
00026 #include "combobox.h"
00027 #include <QPixmap>
00028 #include <QResizeEvent>
00029 #include <QEvent>
00030 
00031 class QToolButton;
00032 
00033 namespace KoProperty {
00034 
00035 class KOPROPERTY_EXPORT BoolEdit : public Widget
00036 {
00037         Q_OBJECT
00038 
00039         public:
00040                 BoolEdit(Property *property, QWidget *parent=0);
00041                 virtual ~BoolEdit();
00042 
00043                 virtual QVariant value() const;
00044                 virtual void setValue(const QVariant &value, bool emitChange=true);
00045 
00046                 virtual void drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value);
00047 
00048         protected slots:
00049                 void  slotValueChanged(bool state);
00050 
00051         protected:
00052                 virtual void setReadOnlyInternal(bool readOnly);
00053                 void setState(bool state);
00054                 virtual void resizeEvent(QResizeEvent *ev);
00055                 virtual bool eventFilter(QObject* watched, QEvent* e);
00056 
00057         private:
00058                 QToolButton *m_toggle;
00059                 QPixmap m_yesIcon, m_noIcon; 
00060 };
00061 
00062 class KOPROPERTY_EXPORT ThreeStateBoolEdit : public ComboBox
00063 {
00064         Q_OBJECT
00065 
00066         public:
00067                 ThreeStateBoolEdit(Property *property, QWidget *parent=0);
00068                 virtual ~ThreeStateBoolEdit();
00069 
00070                 virtual QVariant value() const;
00071                 virtual void setValue(const QVariant &value, bool emitChange=true);
00072 
00073                 virtual void setProperty(Property *property);
00074                 virtual void drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value);
00075                 QPixmap m_yesIcon, m_noIcon; 
00076 };
00077 
00078 }
00079 
00080 #endif

Généré le Wed Nov 22 23:41:06 2006 pour KPlato par  doxygen 1.5.1-p1