kexi
keximacroproperty.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef KEXIMACROPROPERTY_H
00019 #define KEXIMACROPROPERTY_H
00020
00021 #include <ksharedptr.h>
00022 #include <koproperty/property.h>
00023 #include <koproperty/factory.h>
00024 #include <koproperty/customproperty.h>
00025 #include <koproperty/widget.h>
00026
00027 namespace KoMacro {
00028 class Variable;
00029 class MacroItem;
00030 }
00031
00032 class KexiMacroPropertyWidget;
00033
00038 class KexiMacroProperty
00039 : public QObject
00040 , public KoProperty::CustomProperty
00041 {
00042 Q_OBJECT
00043
00044 friend class KexiMacroPropertyWidget;
00045
00046 public:
00047
00049 explicit KexiMacroProperty(KoProperty::Property* parent, KSharedPtr<KoMacro::MacroItem> macroitem, const QString& name);
00051 virtual ~KexiMacroProperty();
00052
00054 KoProperty::Property* parentProperty() const;
00055
00062 virtual void setValue(const QVariant &value, bool rememberOldValue);
00063
00067 virtual QVariant value() const;
00068
00071 virtual bool handleValue() const;
00072
00075 KSharedPtr<KoMacro::MacroItem> macroItem() const;
00076
00079 QString name() const;
00080
00084 KSharedPtr<KoMacro::Variable> variable() const;
00085
00088 static KoProperty::Property* createProperty(KSharedPtr<KoMacro::MacroItem> macroitem, const QString& name);
00089
00090 signals:
00091
00093 void valueChanged();
00094
00095 private:
00097 class Private;
00099 Private* const d;
00101 inline void init();
00102 };
00103
00109 class KexiMacroPropertyFactory : public KoProperty::CustomPropertyFactory
00110 {
00111 public:
00113 explicit KexiMacroPropertyFactory(QObject* parent);
00115 virtual ~KexiMacroPropertyFactory();
00116
00120 virtual KoProperty::CustomProperty* createCustomProperty(KoProperty::Property* parent);
00121
00125 virtual KoProperty::Widget* createCustomWidget(KoProperty::Property* property);
00126
00132 static void initFactory();
00133 };
00134
00139 class KexiMacroPropertyWidget : public KoProperty::Widget
00140 {
00141 Q_OBJECT
00142
00143 public:
00145 explicit KexiMacroPropertyWidget(KoProperty::Property* property, QWidget* parent = 0);
00147 virtual ~KexiMacroPropertyWidget();
00148
00150 virtual QVariant value() const;
00151
00154 virtual void setValue(const QVariant& value, bool emitChange=true);
00155
00156
00157
00158 protected:
00159
00161 virtual void setReadOnlyInternal(bool readOnly);
00162
00163 private slots:
00164
00166 void slotComboBoxChanged();
00167
00169 void slotComboBoxActivated();
00170
00172 void slotWidgetValueChanged();
00173
00176 void slotPropertyValueChanged();
00177
00178 private:
00180 class Private;
00182 Private* const d;
00183 };
00184
00185 #endif
00186
|