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 <QListWidget>
26 #include <klistwidgetsearchline.h>
29 class ConfigModuleList
;
31 class ModuleTreeItem
: public QListWidgetItem
{
34 explicit ModuleTreeItem(QListWidget
* parent
, ConfigModule
* module
= NULL
);
36 ConfigModule
* module() const;
39 ConfigModule
*_module
;
43 class ModuleTreeView
: public QListWidget
{
47 explicit ModuleTreeView(ConfigModuleList
* configModules
, QWidget
* parent
= NULL
);
51 bool isGeneralItem(const QListWidgetItem
* item
) const;
53 QListWidgetItem
* generalItem() const;
55 ModuleTreeItem
* findMatchingItem(ConfigModule
* configModule
) const;
58 void moduleSelected(ConfigModule
* configModule
);
59 void generalSelected();
65 QListWidgetItem
* _generalItem
;
67 ConfigModuleList
* _modules
;
70 class ModuleWidgetSearchLine
: public KListWidgetSearchLine
{
72 ModuleWidgetSearchLine(QWidget
* parent
, ModuleTreeView
* listWidget
);
76 virtual bool itemMatches(const QListWidgetItem
* item
, const QString
& search
) const;