00001 #ifndef __HTMLSEARCH_H__
00002 #define __HTMLSEARCH_H__
00003
00004
00005 #include <tqstring.h>
00006 #include <tqstringlist.h>
00007
00008
00009 class TQWidget;
00010 class TQProgressDialog;
00011
00012
00013 class KProcess;
00014
00015
00016 class ProgressDialog;
00017
00018
00019 class HTMLSearch : public QObject
00020 {
00021 Q_OBJECT
00022
00023 public:
00024
00025 HTMLSearch();
00026
00027 bool generateIndex(TQString lang, TQWidget *parent=0);
00028
00029 TQString search(TQString lang, TQString words, TQString method="and", int matches=10,
00030 TQString format="builtin-long", TQString sort="score");
00031
00032
00033 protected slots:
00034
00035 void htdigStdout(KProcess *proc, char *buffer, int buflen);
00036 void htdigExited(KProcess *proc);
00037 void htmergeExited(KProcess *proc);
00038 void htsearchStdout(KProcess *proc, char *buffer, int buflen);
00039 void htsearchExited(KProcess *proc);
00040
00041
00042 protected:
00043
00044 TQString dataPath(const TQString& lang);
00045
00046 bool saveFilesList(const TQString& lang);
00047 void scanDir(const TQString& dir);
00048
00049 bool createConfig(const TQString& lang);
00050
00051
00052 private:
00053
00054 TQStringList _files;
00055 KProcess *_proc;
00056 int _filesToDig, _filesDigged, _filesScanned;
00057 volatile bool _htdigRunning, _htmergeRunning, _htsearchRunning;
00058 TQString _searchResult;
00059 ProgressDialog *progress;
00060
00061 };
00062
00063
00064 #endif