Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / runtime / khelpcenter / searchwidget.h
blob08bb44ba90f576884df196f403fa2f94d3ebd623
1 /*
2 * searchwidget.h - part of the KDE Help Center
4 * Copyright (C) 1999 Matthias Elter (me@kde.org)
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef __searchwidget_h__
22 #define __searchwidget_h__
24 #include <QWidget>
25 #include <QtDBus/QtDBus>
27 #include "docmetainfo.h"
29 class Q3ListView;
30 class Q3ListViewItem;
31 class QComboBox;
33 class KConfig;
36 namespace KHC {
38 class SearchEngine;
40 class SearchWidget : public QWidget
42 Q_OBJECT
43 Q_CLASSINFO("D-Bus Interface", "org.kde.khelpcenter.searchwidget")
45 public Q_SLOTS:
46 Q_SCRIPTABLE Q_NOREPLY void searchIndexUpdated(); // called from kcmhelpcenter
48 public:
49 explicit SearchWidget ( SearchEngine *, QWidget *parent = 0 );
50 ~SearchWidget();
52 QString method();
53 int pages();
54 QString scope();
56 Q3ListView *listView() { return mScopeListView; }
58 enum { ScopeDefault, ScopeAll, ScopeNone, ScopeCustom, ScopeNum };
60 QString scopeSelectionLabel( int ) const;
62 void readConfig( KConfig * );
63 void writeConfig( KConfig * );
65 int scopeCount() const;
67 SearchEngine *engine() const { return mEngine; }
69 Q_SIGNALS:
70 void searchResult( const QString &url );
71 void scopeCountChanged( int );
72 void showIndexDialog();
74 public Q_SLOTS:
75 void slotSwitchBoxes();
76 void scopeSelectionChanged( int );
77 void updateScopeList();
79 protected:
80 void checkScope();
82 protected Q_SLOTS:
83 void scopeDoubleClicked( Q3ListViewItem * );
84 void scopeClicked( Q3ListViewItem * );
86 private:
87 void loadLanguages();
89 SearchEngine *mEngine;
91 QComboBox *mMethodCombo;
92 QComboBox *mPagesCombo;
93 QComboBox *mScopeCombo;
94 Q3ListView *mScopeListView;
96 int mScopeCount;
101 #endif
102 // vim:ts=2:sw=2:et