00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __searchwidget_h__
00022 #define __searchwidget_h__
00023
00024 #include <tqwidget.h>
00025 #include <tqptrlist.h>
00026 #include <tqstring.h>
00027 #include <tqstringlist.h>
00028
00029 #include "modules.h"
00030
00031 class KListBox;
00032 class KLineEdit;
00033 class TQListBoxItem;
00034
00035 class KeywordListEntry
00036 {
00037 public:
00038 KeywordListEntry(const TQString& name, ConfigModule* module);
00039
00040 void addModule(ConfigModule* module);
00041
00042 TQString moduleName() { return _name; }
00043 TQPtrList<ConfigModule> modules() { return _modules; }
00044
00045 private:
00046 TQString _name;
00047 TQPtrList<ConfigModule> _modules;
00048
00049 };
00050
00051 class SearchWidget : public QWidget
00052 {
00053 Q_OBJECT
00054
00055 public:
00056 SearchWidget(TQWidget *parent, const char *name=0);
00057
00058 void populateKeywordList(ConfigModuleList *list);
00059 void searchTextChanged(const TQString &);
00060
00061 signals:
00062 void moduleSelected(ConfigModule *);
00063
00064 protected:
00065 void populateKeyListBox(const TQString& regexp);
00066 void populateResultListBox(const TQString& keyword);
00067
00068 protected slots:
00069 void slotKeywordSelected(const TQString &);
00070 void slotModuleSelected(TQListBoxItem *item);
00071 void slotModuleClicked(TQListBoxItem *item);
00072
00073 private:
00074 KListBox *_keyList, *_resultList;
00075 TQPtrList<KeywordListEntry> _keywords;
00076 };
00077
00078 #endif