kexi
widgetpropertyset.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KFD_WIDGETPROPERTYSET_H
00022 #define KFD_WIDGETPROPERTYSET_H
00023
00024 #include <qobject.h>
00025 #include <qstrlist.h>
00026
00027 #include <koproperty/set.h>
00028 #include <koproperty/property.h>
00029
00030 class QMetaObject;
00031 class QWidget;
00032
00033 namespace KFormDesigner {
00034
00035 class FormManager;
00036 class ObjectTreeItem;
00037 class WidgetPropertySetPrivate;
00038 class WidgetInfo;
00039 class CommandGroup;
00040
00041 class KFORMEDITOR_EXPORT WidgetPropertySet : public QObject
00042 {
00043 Q_OBJECT
00044
00045 public:
00046 WidgetPropertySet(QObject *parent);
00047 ~WidgetPropertySet();
00048
00049
00050
00051 KoProperty::Property& operator[](const QCString &name);
00052
00053 KoProperty::Property& property(const QCString &name);
00054
00055 bool contains(const QCString &property);
00056
00059 void addPropertyCaption(const QCString &property, const QString &caption);
00060
00061 void addValueCaption(const QCString &value, const QString &caption);
00062
00063 public slots:
00072 void setSelectedWidget(QWidget *w, bool add = false, bool forceReload = false,
00073 bool moreWillBeSelected = false);
00074
00075 void setSelectedWidgetWithoutReload(QWidget *w, bool add = false, bool moreWillBeSelected = false) {
00076 setSelectedWidget(w, add, false, moreWillBeSelected);
00077 }
00078
00081 void slotPropertyChanged(KoProperty::Set& set, KoProperty::Property& property);
00082
00084 void slotPropertyReset(KoProperty::Set& set, KoProperty::Property& property);
00085
00087 void slotWidgetDestroyed();
00088
00089
00090 void createPropertyCommandsInDesignMode(QWidget* widget, const QMap<QCString,
00091 QVariant> &propValues, CommandGroup *group, bool addToActiveForm = true,
00092 bool execFlagForSubCommands = false);
00093
00094 signals:
00098 void widgetPropertyChanged(QWidget *w, const QCString &property, const QVariant &v);
00099
00103 void widgetNameChanged(const QCString &oldname, const QCString &newname);
00104
00105 protected:
00107 void addWidget(QWidget *w);
00108
00111 void createPropertiesForWidget(QWidget *w);
00112
00115 KoProperty::Property::ListData* createValueList(WidgetInfo *winfo, const QStringList &list);
00116
00119 void updatePropertyValue(ObjectTreeItem *tree, const char *property, const QMetaProperty *meta = 0);
00120
00123 KoProperty::Set* set();
00124
00126 void clearSet(bool dontSignalShowPropertySet = false);
00127
00130 void saveModifiedProperties();
00131
00134 bool isNameValid(const QString &name);
00135
00137 void saveEnabledProperty(bool value);
00138
00142 bool eventFilter(QObject *o, QEvent *ev);
00143
00146 void setUndoing(bool isUndoing);
00147
00148 bool isUndoing();
00149
00153 bool isPropertyVisible(const QCString &property, bool isTopLevel,
00154 const QCString &classname=QCString());
00155
00156
00157
00158
00164 void createAlignProperty(const QMetaProperty *meta, QWidget *widget, QWidget *subwidget);
00165
00168 void saveAlignProperty(const QString &property);
00169
00171 void createLayoutProperty(ObjectTreeItem *item);
00172
00175 void saveLayoutProperty(const QString &property, const QVariant &value);
00176
00177
00179 void initPropertiesDescription();
00180
00183 QString propertyCaption(const QCString &name);
00184
00186 QString valueCaption(const QCString &name);
00187
00190
00191
00193 void emitWidgetPropertyChanged(QWidget *w, const QCString& property, const QVariant& value);
00194
00195 private:
00196 WidgetPropertySetPrivate *d;
00197
00198 friend class FormManager;
00199 friend class PropertyCommand;
00200 friend class LayoutPropertyCommand;
00201 friend class GeometryPropertyCommand;
00202 };
00203
00204 }
00205
00206 #endif
|