2 Copyright (c) 2000 Matthias Elter <elter@kde.org>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program 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
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef __moduletreeview_h__
21 #define __moduletreeview_h__
23 #include <Qt3Support/Q3PtrList>
24 #include <Qt3Support/Q3CheckListItem>
28 #include <k3listview.h>
29 #include <Qt3Support/Q3Dict>
33 class ConfigModuleList
;
36 class ModuleTreeItem
: public Q3ListViewItem
40 explicit ModuleTreeItem(Q3ListViewItem
*parent
, ConfigModule
*module
= 0);
41 ModuleTreeItem(Q3ListViewItem
*parent
, const QString
& text
);
42 explicit ModuleTreeItem(Q3ListView
*parent
, ConfigModule
*module
= 0);
43 ModuleTreeItem(Q3ListView
*parent
, const QString
& text
);
45 void setTag(const QString
& tag
) { _tag
= tag
; }
46 void setCaption(const QString
& caption
) { _caption
= caption
; }
47 void setModule(ConfigModule
*m
) { _module
= m
; }
48 QString
tag() const { return _tag
; }
49 QString
caption() const { return _caption
; }
50 ConfigModule
*module() { return _module
; }
51 void regChildIconWidth(int width
);
52 int maxChildIconWidth() { return _maxChildIconWidth
; }
54 void setPixmap(int column
, const QPixmap
& pm
);
55 void setGroup(const QString
&path
);
58 void paintCell( QPainter
* p
, const QColorGroup
& cg
, int column
, int width
, int align
);
61 ConfigModule
*_module
;
64 int _maxChildIconWidth
;
67 class ModuleTreeView
: public K3ListView
72 explicit ModuleTreeView(ConfigModuleList
*list
, QWidget
* parent
= 0);
74 void makeSelected(ConfigModule
* module
);
75 void makeVisible(ConfigModule
*module
);
77 QSize
sizeHint() const;
80 void moduleSelected(ConfigModule
*);
81 void categorySelected(Q3ListViewItem
*);
84 void slotItemSelected(Q3ListViewItem
*);
87 void updateItem(ModuleTreeItem
*item
, ConfigModule
* module
);
88 void keyPressEvent(QKeyEvent
*);
89 void fill(ModuleTreeItem
*parent
, const QString
&parentPath
);
92 ConfigModuleList
*_modules
;