editlistviewdialog.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef EDITLISTVIEW_DIALOG_H
21#define EDITLISTVIEW_DIALOG_H
22
23#include <tqintdict.h>
24#include <tqtoolbutton.h>
25#include <kdialogbase.h>
26
27class TQFrame;
28class TQListView;
29class TQListViewItem;
30class TDEListViewItem;
31class TDEListView;
32class TDEListBox;
33class TQListBoxItem;
34
35namespace KoProperty {
36 class Property;
37 class Set;
38 class Editor;
39}
40
41namespace KFormDesigner {
42
44
49class KFORMEDITOR_EXPORT EditListViewDialog : public KDialogBase
50{
51 TQ_OBJECT
52
53
54 public:
55 EditListViewDialog(TQWidget *parent);
57
58 int exec(TQListView *listview);
59
60 public slots:
61 // Columns page
62 void updateItemProperties(TQListBoxItem*);
63 void newItem();
64 void removeItem();
65 void MoveItemUp();
66 void MoveItemDown();
67 void changeProperty(KoProperty::Set& set, KoProperty::Property& property);
68
69 // Contents page
70 void updateButtons(TQListViewItem*);
71 void newRow();
72 void newChildRow();
73 void removeRow();
74 void MoveRowUp();
75 void MoveRowDown();
76
77 protected:
80 void loadChildNodes(TQListView *listview, TQListViewItem *item, TQListViewItem *parent);
81
82 protected:
83 enum { BNewRow = 10, BNewChild, BRemRow, BRowUp, BRowDown , BColAdd = 20, BColRem, BColUp, BColDown };
84 KoProperty::Editor *m_editor;
85 KoProperty::Set *m_propSet;
86 TQFrame *m_contents, *m_column;
87 TDEListBox *m_listbox;
88 TDEListView *m_listview;
89 TQIntDict<TQToolButton> m_buttons;
90};
91
92}
93
94#endif
A dialog to edit the contents of a listvuew (TDEListView or TQListView)