Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / runtime / khelpcenter / kcmhelpcenter.h
blobc10226dc1ce0c916409c77d00ec311225a34f1ab
1 /*
2 This file is part of KHelpcenter.
4 Copyright (C) 2002 Cornelius Schumacher <schumacher@kde.org>
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (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 GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
21 #ifndef KCMHELPCENTER_H
22 #define KCMHELPCENTER_H
24 #include <kdialog.h>
25 #include <ksharedconfig.h>
26 #include <KProcess>
28 #include "scopeitem.h"
30 class QPushButton;
31 class QProgressBar;
32 class QTextEdit;
33 class QLabel;
35 class KAboutData;
36 class KTemporaryFile;
37 class KUrlRequester;
38 class K3ListView;
40 namespace KHC {
41 class HtmlSearchConfig;
42 class DocEntry;
43 class SearchEngine;
46 class IndexDirDialog : public KDialog
48 Q_OBJECT
49 public:
50 IndexDirDialog( QWidget *parent );
52 protected Q_SLOTS:
53 void slotOk();
54 void slotUrlChanged( const QString &_url);
55 private:
56 KUrlRequester *mIndexUrlRequester;
59 class IndexProgressDialog : public KDialog
61 Q_OBJECT
62 public:
63 IndexProgressDialog( QWidget *parent );
64 ~IndexProgressDialog();
66 void setTotalSteps( int );
67 void advanceProgress();
68 void setLabelText( const QString & );
69 void setMinimumLabelWidth( int width );
70 void setFinished( bool );
72 void appendLog( const QString &text );
74 Q_SIGNALS:
75 void closed();
76 void cancelled();
78 protected:
79 void hideDetails();
81 protected Q_SLOTS:
82 void slotEnd();
83 void toggleDetails();
85 private:
86 QLabel *mLabel;
87 QProgressBar *mProgressBar;
88 QLabel *mLogLabel;
89 QTextEdit *mLogView;
91 bool mFinished;
94 class KCMHelpCenter : public KDialog
96 Q_OBJECT
97 public:
98 explicit KCMHelpCenter( KHC::SearchEngine *, QWidget *parent = 0,
99 const char *name = 0 );
100 ~KCMHelpCenter();
102 void load();
103 bool save();
104 void defaults();
106 public Q_SLOTS:
108 Q_SIGNALS:
109 void searchIndexUpdated();
110 public Q_SLOTS:
111 void slotIndexError( const QString & );
112 void slotIndexProgress();
113 protected Q_SLOTS:
114 bool buildIndex();
115 void cancelBuildIndex();
116 void slotIndexFinished( int exitCode, QProcess::ExitStatus exitStatus );
117 void slotReceivedStdout();
118 void slotReceivedStderr();
119 void slotProgressClosed();
121 void slotOk();
123 void showIndexDirDialog();
125 void checkSelection();
127 protected:
128 void setupMainWidget( QWidget *parent );
129 void updateStatus();
130 void startIndexProcess();
132 void deleteProcess();
133 void deleteCmdFile();
135 void advanceProgress();
137 private:
138 KHC::SearchEngine *mEngine;
140 K3ListView *mListView;
141 QLabel *mIndexDirLabel;
142 QPushButton *mBuildButton;
143 IndexProgressDialog *mProgressDialog;
145 QList<KHC::DocEntry *> mIndexQueue;
146 QList<KHC::DocEntry *>::ConstIterator mCurrentEntry;
148 KSharedConfigPtr mConfig;
150 KAboutData *mAboutData;
152 KHC::HtmlSearchConfig *mHtmlSearchTab;
153 QWidget *mScopeTab;
155 KTemporaryFile *mCmdFile;
157 KProcess *mProcess;
159 bool mIsClosing;
161 QByteArray mStdOut;
162 QByteArray mStdErr;
164 bool mRunAsRoot;
167 #endif
168 // vim:ts=2:sw=2:et