summaryrefslogtreecommitdiffstats
path: root/khelpcenter/htmlsearch/htmlsearch.h
blob: e0c533f8137f783df26ae76f96ae2efceef34ace (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef __HTMLSEARCH_H__
#define __HTMLSEARCH_H__


#include <tqstring.h>
#include <tqstringlist.h>


class TQWidget;
class TQProgressDialog;


class TDEProcess;


class ProgressDialog;


class HTMLSearch : public TQObject
{
  TQ_OBJECT

public:

  HTMLSearch();

  bool generateIndex(TQString lang, TQWidget *parent=0);

  TQString search(TQString lang, TQString words, TQString method="and", int matches=10,
		 TQString format="builtin-long", TQString sort="score");


protected slots:

  void htdigStdout(TDEProcess *proc, char *buffer, int buflen);
  void htdigExited(TDEProcess *proc);
  void htmergeExited(TDEProcess *proc);
  void htsearchStdout(TDEProcess *proc, char *buffer, int buflen);
  void htsearchExited(TDEProcess *proc);


protected:

  TQString dataPath(const TQString& lang);

  bool saveFilesList(const TQString& lang);
  void scanDir(const TQString& dir);

  bool createConfig(const TQString& lang);


private:

  TQStringList   _files;
  TDEProcess      *_proc;
  int           _filesToDig, _filesDigged, _filesScanned;
  volatile bool _htdigRunning, _htmergeRunning, _htsearchRunning;
  TQString       _searchResult;
  ProgressDialog *progress;

};


#endif