Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / apps / kinfocenter / searchwidget.h
blob266c77a783f9673232c1b36682b2d2efd3834817
1 /*
2 Copyright (c) 2000 Matthias Elter <elter@kde.org>
3 Copyright (c) 2004 Daniel Molkentin <molkentin@kde.org>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License along
16 along with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef __searchwidget_h__
21 #define __searchwidget_h__
23 #include <QWidget>
24 #include <Qt3Support/Q3PtrList>
26 #include "modules.h"
28 class KListWidget;
29 class KLineEdit;
30 class QListWidgetItem;
32 class KeywordListEntry
34 public:
35 KeywordListEntry(const QString& name, ConfigModule* module);
37 void addModule(ConfigModule* module);
39 QString moduleName() { return _name; }
40 Q3PtrList<ConfigModule> modules() { return _modules; }
42 private:
43 QString _name;
44 Q3PtrList<ConfigModule> _modules;
48 class SearchWidget : public QWidget
50 Q_OBJECT
52 public:
53 SearchWidget(QWidget *parent);
55 void populateKeywordList(ConfigModuleList *list);
57 Q_SIGNALS:
58 void moduleSelected(ConfigModule *);
60 protected:
61 void populateKeyListBox(const QString& regexp);
62 void populateResultListBox(const QString& keyword);
64 protected Q_SLOTS:
65 void slotSearchTextChanged(const QString &);
66 void slotKeywordSelected(const QString &);
67 void slotModuleSelected(QListWidgetItem *item);
68 void slotModuleClicked(QListWidgetItem *item);
70 private:
71 KListWidget *_keyList, *_resultList;
72 KLineEdit *_input;
73 Q3PtrList<KeywordListEntry> _keywords;
76 #endif