00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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