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:
00067 void setSelectedWidget(QWidget *w, bool add=false);
00068
00071 void slotPropertyChanged(KoProperty::Set& set, KoProperty::Property& property);
00072
00074 void slotPropertyReset(KoProperty::Set& set, KoProperty::Property& property);
00075
00077 void slotWidgetDestroyed();
00078
00079
00080 void createPropertyCommandsInDesignMode(QWidget* widget, const QMap<QCString,
00081 QVariant> &propValues, CommandGroup *group, bool addToActiveForm = true,
00082 bool execFlagForSubCommands = false);
00083
00084 signals:
00088 void widgetPropertyChanged(QWidget *w, const QCString &property, const QVariant &v);
00089
00093 void widgetNameChanged(const QCString &oldname, const QCString &newname);
00094
00095 protected:
00097 void addWidget(QWidget *w);
00098
00101 void createPropertiesForWidget(QWidget *w);
00102
00105 KoProperty::Property::ListData* createValueList(WidgetInfo *winfo, const QStringList &list);
00106
00109 void updatePropertyValue(ObjectTreeItem *tree, const char *property);
00110
00113 KoProperty::Set* set();
00114
00116 void clearSet(bool dontSignalShowPropertySet = false);
00117
00120 void saveModifiedProperties();
00121
00124 bool isNameValid(const QString &name);
00125
00127 void saveEnabledProperty(bool value);
00128
00132 bool eventFilter(QObject *o, QEvent *ev);
00133
00136 void setUndoing(bool isUndoing);
00137
00138 bool isUndoing();
00139
00143 bool isPropertyVisible(const QCString &property, bool isTopLevel,
00144 const QCString &classname=QCString());
00145
00146
00147
00150 void createAlignProperty(const QMetaProperty *meta, QWidget *obj);
00151
00154 void saveAlignProperty(const QString &property);
00155
00157 void createLayoutProperty(ObjectTreeItem *item);
00158
00161 void saveLayoutProperty(const QString &property, const QVariant &value);
00162
00163
00165 void initPropertiesDescription();
00166
00169 QString propertyCaption(const QCString &name);
00170
00172 QString valueCaption(const QCString &name);
00173
00176
00177
00178 private:
00179 WidgetPropertySetPrivate *d;
00180
00181 friend class FormManager;
00182 friend class PropertyCommand;
00183 friend class LayoutPropertyCommand;
00184 friend class GeometryPropertyCommand;
00185 };
00186
00187 }
00188
00189 #endif
|