lib

editor.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
3 Copyright (C) 2004 Alexander Dymo <cloudtemple@mskat.net>
4 Copyright (C) 2004-2006 Jaroslaw Staniek <js@iidea.pl>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20*/
21
22#ifndef KPROPERTY_PROPERTYEDITOR_H
23#define KPROPERTY_PROPERTYEDITOR_H
24
25#include <tqguardedptr.h>
26#include "koproperty_global.h"
27
28#include <tdelistview.h>
29
30class TQSize;
31
32namespace KoProperty {
33
34class EditorPrivate;
35class Property;
36class Set;
37class Widget;
38class EditorItem;
39
40
63class KOPROPERTY_EXPORT Editor : public TDEListView
64{
65 TQ_OBJECT
66
67
68 public:
76 Editor(TQWidget *parent=0, bool autoSync=true, const char *name=0);
77
78 virtual ~Editor();
79
80 virtual TQSize sizeHint() const;
81 virtual void setFocus();
82 virtual void setSorting( int column, bool ascending = true );
83
84 public slots:
89 void changeSet(Set *set, bool preservePrevSelection = false);
90
95 void changeSet(Set *set, const TQCString& propertyToSelect);
96
101 void clear(bool editorOnly = false);
102
104 void acceptInput();
105
106 signals:
109
110 protected slots:
113
114 void slotPropertyReset(KoProperty::Set& set, KoProperty::Property& property);
115
117 void slotWidgetValueChanged(Widget* widget);
118
121 void slotWidgetAcceptInput(Widget *widget);
122
124 void slotWidgetRejectInput(Widget *widget);
125
128
131
135 void slotClicked(TQListViewItem *item);
136
138 void undo();
139
140 void updateEditorGeometry(bool forceUndoButtonSettings = false, bool undoButtonVisible = false);
141 void updateEditorGeometry(EditorItem *item, Widget* widget, bool forceUndoButtonSettings = false, bool undoButtonVisible = false);
142 void updateGroupLabelsPosition();
143
144 void hideEditor();
145
146 void slotCollapsed(TQListViewItem *item);
147 void slotExpanded(TQListViewItem *item);
148 void slotColumnSizeChanged(int section);
149 void slotColumnSizeChanged(int section, int oldSize, int newSize);
150 void slotCurrentChanged(TQListViewItem *item);
151 void changeSetLater();
152 void selectItemLater();
153 protected:
157 Widget *createWidgetForProperty(Property *property, bool changeWidgetProperty=true);
158
160 void clearWidgetCache();
161
162 void fill();
163 void addItem(const TQCString &name, EditorItem *parent);
164
165 void showUndoButton( bool show );
166
167 virtual void resizeEvent(TQResizeEvent *ev);
168 virtual bool eventFilter( TQObject * watched, TQEvent * e );
169 bool handleKeyPress(TQKeyEvent* ev);
170
171 virtual bool event( TQEvent * e );
172 void updateFont();
173
174 virtual void contentsMousePressEvent( TQMouseEvent * e );
175
177 void changeSetInternal(Set *set, bool preservePrevSelection,
178 const TQCString& propertyToSelect);
179
180 private:
181 EditorPrivate *d;
182
183 friend class EditorItem;
184 friend class Widget;
185};
186
187}
188
189#endif
Item for a single property displayed within Editor object.
Definition editoritem.h:48
void slotWidgetValueChanged(Widget *widget)
Definition editor.cpp:517
void slotSetWillBeDeleted()
Definition editor.cpp:624
Editor(TQWidget *parent=0, bool autoSync=true, const char *name=0)
Definition editor.cpp:121
void slotWidgetRejectInput(Widget *widget)
Definition editor.cpp:557
void changeSetInternal(Set *set, bool preservePrevSelection, const TQCString &propertyToSelect)
Definition editor.cpp:296
void clearWidgetCache()
Definition editor.cpp:667
void slotClicked(TQListViewItem *item)
Definition editor.cpp:566
void slotWidgetAcceptInput(Widget *widget)
Definition editor.cpp:548
void slotSetWillBeCleared()
Definition editor.cpp:613
void addItem(const TQCString &name, EditorItem *parent)
Definition editor.cpp:248
void clear(bool editorOnly=false)
Definition editor.cpp:406
void propertySetChanged(KoProperty::Set *set)
Widget * createWidgetForProperty(Property *property, bool changeWidgetProperty=true)
Definition editor.cpp:631
void changeSet(Set *set, bool preservePrevSelection=false)
Definition editor.cpp:284
void slotPropertyChanged(KoProperty::Set &set, KoProperty::Property &property)
Definition editor.cpp:441
The base class representing a single property.
Definition property.h:177
Lists holding properties in groups.
Definition set.h:41
The base class for all item editors used in Editor.
Definition widget.h:37
TDEListView(TQWidget *parent=0, const char *name=0)
Namespace for a set of classes implementing generic properties framework.