Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / apps / kinfocenter / moduletreeview.h
bloba758365f00943645be5467046a487a111e76af51
1 /*
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>
25 //Added by qt3to4:
26 #include <QPixmap>
27 #include <QKeyEvent>
28 #include <k3listview.h>
29 #include <Qt3Support/Q3Dict>
32 class ConfigModule;
33 class ConfigModuleList;
34 class QPainter;
36 class ModuleTreeItem : public Q3ListViewItem
39 public:
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);
57 protected:
58 void paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align );
60 private:
61 ConfigModule *_module;
62 QString _tag;
63 QString _caption;
64 int _maxChildIconWidth;
67 class ModuleTreeView : public K3ListView
69 Q_OBJECT
71 public:
72 explicit ModuleTreeView(ConfigModuleList *list, QWidget * parent = 0);
74 void makeSelected(ConfigModule* module);
75 void makeVisible(ConfigModule *module);
76 void fill();
77 QSize sizeHint() const;
79 Q_SIGNALS:
80 void moduleSelected(ConfigModule*);
81 void categorySelected(Q3ListViewItem*);
83 protected Q_SLOTS:
84 void slotItemSelected(Q3ListViewItem*);
86 protected:
87 void updateItem(ModuleTreeItem *item, ConfigModule* module);
88 void keyPressEvent(QKeyEvent *);
89 void fill(ModuleTreeItem *parent, const QString &parentPath);
91 private:
92 ConfigModuleList *_modules;
95 #endif