|
a/src/qtgui/ssearch_w.h |
|
b/src/qtgui/ssearch_w.h |
|
... |
|
... |
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
16 |
*/
|
16 |
*/
|
17 |
#ifndef _SSEARCH_W_H_INCLUDED_
|
17 |
#ifndef _SSEARCH_W_H_INCLUDED_
|
18 |
#define _SSEARCH_W_H_INCLUDED_
|
18 |
#define _SSEARCH_W_H_INCLUDED_
|
19 |
|
19 |
|
|
|
20 |
#include <string>
|
|
|
21 |
|
20 |
#include <QVariant>
|
22 |
#include <QVariant>
|
21 |
#include <QWidget>
|
23 |
#include <QWidget>
|
22 |
|
24 |
|
23 |
class QTimer;
|
25 |
class QTimer;
|
24 |
|
26 |
|
|
... |
|
... |
26 |
#include "searchdata.h"
|
28 |
#include "searchdata.h"
|
27 |
#include "refcntr.h"
|
29 |
#include "refcntr.h"
|
28 |
|
30 |
|
29 |
#include "ui_ssearchb.h"
|
31 |
#include "ui_ssearchb.h"
|
30 |
|
32 |
|
|
|
33 |
struct SSearchDef;
|
|
|
34 |
|
31 |
class SSearch : public QWidget, public Ui::SSearchBase
|
35 |
class SSearch : public QWidget, public Ui::SSearchBase
|
32 |
{
|
36 |
{
|
33 |
Q_OBJECT
|
37 |
Q_OBJECT
|
34 |
|
38 |
|
35 |
public:
|
39 |
public:
|
|
|
40 |
// The values MUST NOT change, there are assumptions about them in
|
|
|
41 |
// different parts of the code
|
36 |
enum SSearchType {SST_ANY = 0, SST_ALL = 1, SST_FNM = 2, SST_LANG = 3};
|
42 |
enum SSearchType {SST_ANY = 0, SST_ALL = 1, SST_FNM = 2, SST_LANG = 3};
|
37 |
|
43 |
|
38 |
SSearch(QWidget* parent = 0, const char * = 0)
|
44 |
SSearch(QWidget* parent = 0, const char * = 0)
|
39 |
: QWidget(parent)
|
45 |
: QWidget(parent)
|
40 |
{
|
46 |
{
|
|
... |
|
... |
45 |
virtual void init();
|
51 |
virtual void init();
|
46 |
virtual void setAnyTermMode();
|
52 |
virtual void setAnyTermMode();
|
47 |
virtual void completion();
|
53 |
virtual void completion();
|
48 |
virtual bool eventFilter(QObject *target, QEvent *event);
|
54 |
virtual bool eventFilter(QObject *target, QEvent *event);
|
49 |
virtual bool hasSearchString();
|
55 |
virtual bool hasSearchString();
|
50 |
virtual void setPrefs();
|
56 |
virtual void setPrefs();
|
|
|
57 |
// Return last performed search as XML text.
|
|
|
58 |
virtual std::string asXML();
|
|
|
59 |
// Restore ssearch UI from saved search
|
|
|
60 |
virtual bool fromXML(const SSearchDef& fxml);
|
|
|
61 |
|
51 |
public slots:
|
62 |
public slots:
|
52 |
virtual void searchTextChanged(const QString & text);
|
63 |
virtual void searchTextChanged(const QString & text);
|
53 |
virtual void searchTypeChanged(int);
|
64 |
virtual void searchTypeChanged(int);
|
54 |
virtual void setSearchString(const QString& text);
|
65 |
virtual void setSearchString(const QString& text);
|
55 |
virtual void startSimpleSearch();
|
66 |
virtual void startSimpleSearch();
|
|
... |
|
... |
74 |
bool m_disableAutosearch;
|
85 |
bool m_disableAutosearch;
|
75 |
QTimer *m_stroketimeout;
|
86 |
QTimer *m_stroketimeout;
|
76 |
bool m_keystroke;
|
87 |
bool m_keystroke;
|
77 |
QString m_tstartqs;
|
88 |
QString m_tstartqs;
|
78 |
QAbstractItemModel *m_savedModel;
|
89 |
QAbstractItemModel *m_savedModel;
|
|
|
90 |
std::string m_xml; /* Saved xml version of the search, as we start it */
|
79 |
|
91 |
|
80 |
int partialWord(string& s);
|
92 |
int partialWord(string& s);
|
81 |
int completionList(string s, QStringList& lst, int max = 100);
|
93 |
int completionList(string s, QStringList& lst, int max = 100);
|
82 |
bool startSimpleSearch(const string& q, int maxexp = -1);
|
94 |
bool startSimpleSearch(const string& q, int maxexp = -1);
|
83 |
};
|
95 |
};
|