lib
editor.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KPROPERTY_PROPERTYEDITOR_H
00023 #define KPROPERTY_PROPERTYEDITOR_H
00024
00025 #include <qguardedptr.h>
00026 #include "koproperty_global.h"
00027
00028 #ifdef QT_ONLY
00029 #include <qlistview.h>
00030 #else
00031 #include <klistview.h>
00032
00033 #endif
00034
00035 class QSize;
00036
00037 namespace KoProperty {
00038
00039 class EditorPrivate;
00040 class Property;
00041 class Set;
00042 class Widget;
00043 class EditorItem;
00044
00046
00061 class KOPROPERTY_EXPORT Editor : public KListView
00062 {
00063 Q_OBJECT
00064
00065 public:
00073 Editor(QWidget *parent=0, bool autoSync=true, const char *name=0);
00074
00075 virtual ~Editor();
00076
00077 virtual QSize sizeHint() const;
00078 virtual void setFocus();
00079
00080 public slots:
00084 void changeSet(Set *set, bool preservePrevSelection=false);
00085
00090 void clear(bool editorOnly = false);
00091
00093 void acceptInput();
00094
00095 signals:
00097 void propertySetChanged(KoProperty::Set *set);
00098
00099 protected slots:
00101 void slotPropertyChanged(KoProperty::Set& set, KoProperty::Property& property);
00102
00103 void slotPropertyReset(KoProperty::Set& set, KoProperty::Property& property);
00104
00106 void slotWidgetValueChanged(Widget *widget);
00107
00110 void slotWidgetAcceptInput(Widget *widget);
00111
00113 void slotWidgetRejectInput(Widget *widget);
00114
00116 void slotSetWillBeCleared();
00117
00119 void slotSetWillBeDeleted();
00120
00124 void slotClicked(QListViewItem *item);
00125
00127 void undo();
00128
00129 void updateEditorGeometry(bool forceUndoButtonSettings = false, bool undoButtonVisible = false);
00130 void updateEditorGeometry(EditorItem *item, Widget* widget, bool forceUndoButtonSettings = false, bool undoButtonVisible = false);
00131
00132 void hideEditor();
00133
00134 void slotCollapsed(QListViewItem *item);
00135 void slotExpanded(QListViewItem *item);
00136 void slotColumnSizeChanged(int section);
00137 void slotColumnSizeChanged(int section, int oldSize, int newSize);
00138 void slotCurrentChanged(QListViewItem *item);
00139 void changeSetLater();
00140 void selectItemLater();
00141 protected:
00145 Widget *createWidgetForProperty(Property *property, bool changeWidgetProperty=true);
00146
00148 void clearWidgetCache();
00149
00150 void fill();
00151 void addItem(const QCString &name, EditorItem *parent);
00152
00153 void showUndoButton( bool show );
00154
00155 virtual void resizeEvent(QResizeEvent *ev);
00156 virtual bool eventFilter( QObject * watched, QEvent * e );
00157 bool handleKeyPress(QKeyEvent* ev);
00158
00159 virtual bool event( QEvent * e );
00160 void updateFont();
00161
00162 virtual void contentsMousePressEvent( QMouseEvent * e );
00163
00164 private:
00165 EditorPrivate *d;
00166
00167 friend class EditorItem;
00168 friend class Widget;
00169 };
00170
00171 }
00172
00173 #endif
|