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 #include <klistview.h>
00029
00030 class QSize;
00031
00032 namespace KoProperty {
00033
00034 class EditorPrivate;
00035 class Property;
00036 class Set;
00037 class Widget;
00038 class EditorItem;
00039
00040
00063 class KOPROPERTY_EXPORT Editor : public KListView
00064 {
00065 Q_OBJECT
00066
00067 public:
00075 Editor(QWidget *parent=0, bool autoSync=true, const char *name=0);
00076
00077 virtual ~Editor();
00078
00079 virtual QSize sizeHint() const;
00080 virtual void setFocus();
00081 virtual void setSorting( int column, bool ascending = true );
00082
00083 public slots:
00088 void changeSet(Set *set, bool preservePrevSelection = false);
00089
00094 void changeSet(Set *set, const QCString& propertyToSelect);
00095
00100 void clear(bool editorOnly = false);
00101
00103 void acceptInput();
00104
00105 signals:
00107 void propertySetChanged(KoProperty::Set *set);
00108
00109 protected slots:
00111 void slotPropertyChanged(KoProperty::Set& set, KoProperty::Property& property);
00112
00113 void slotPropertyReset(KoProperty::Set& set, KoProperty::Property& property);
00114
00116 void slotWidgetValueChanged(Widget* widget);
00117
00120 void slotWidgetAcceptInput(Widget *widget);
00121
00123 void slotWidgetRejectInput(Widget *widget);
00124
00126 void slotSetWillBeCleared();
00127
00129 void slotSetWillBeDeleted();
00130
00134 void slotClicked(QListViewItem *item);
00135
00137 void undo();
00138
00139 void updateEditorGeometry(bool forceUndoButtonSettings = false, bool undoButtonVisible = false);
00140 void updateEditorGeometry(EditorItem *item, Widget* widget, bool forceUndoButtonSettings = false, bool undoButtonVisible = false);
00141 void updateGroupLabelsPosition();
00142
00143 void hideEditor();
00144
00145 void slotCollapsed(QListViewItem *item);
00146 void slotExpanded(QListViewItem *item);
00147 void slotColumnSizeChanged(int section);
00148 void slotColumnSizeChanged(int section, int oldSize, int newSize);
00149 void slotCurrentChanged(QListViewItem *item);
00150 void changeSetLater();
00151 void selectItemLater();
00152 protected:
00156 Widget *createWidgetForProperty(Property *property, bool changeWidgetProperty=true);
00157
00159 void clearWidgetCache();
00160
00161 void fill();
00162 void addItem(const QCString &name, EditorItem *parent);
00163
00164 void showUndoButton( bool show );
00165
00166 virtual void resizeEvent(QResizeEvent *ev);
00167 virtual bool eventFilter( QObject * watched, QEvent * e );
00168 bool handleKeyPress(QKeyEvent* ev);
00169
00170 virtual bool event( QEvent * e );
00171 void updateFont();
00172
00173 virtual void contentsMousePressEvent( QMouseEvent * e );
00174
00176 void changeSetInternal(Set *set, bool preservePrevSelection,
00177 const QCString& propertyToSelect);
00178
00179 private:
00180 EditorPrivate *d;
00181
00182 friend class EditorItem;
00183 friend class Widget;
00184 };
00185
00186 }
00187
00188 #endif
|