source: trunk/tools/assistant/lib/fulltextsearch/qsearchable_p.h

Last change on this file was 846, checked in by Dmitry A. Kuminov, 14 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

File size: 3.5 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team.
4** All rights reserved.
5**
6** Portion Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
7** All rights reserved.
8**
9** This file may be used under the terms of the GNU Lesser General Public
10** License version 2.1 as published by the Free Software Foundation and
11** appearing in the file LICENSE.LGPL included in the packaging of this file.
12** Please review the following information to ensure the GNU Lesser General
13** Public License version 2.1 requirements will be met:
14** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
15**
16****************************************************************************/
17
18#ifndef QSEARCHABLE_P_H
19#define QSEARCHABLE_P_H
20
21//
22// W A R N I N G
23// -------------
24//
25// This file is not part of the Qt API. It exists for the convenience
26// of the help generator tools. This header file may change from version
27// to version without notice, or even be removed.
28//
29// We mean it.
30//
31
32#include "qhits_p.h"
33#include "qsort_p.h"
34#include "qquery_p.h"
35#include "qfilter_p.h"
36#include "qdocument_p.h"
37#include "qindexreader_p.h"
38#include "qclucene_global_p.h"
39
40#include <QtCore/QList>
41#include <QtCore/QString>
42#include <QtCore/QSharedDataPointer>
43#include <QtCore/QSharedData>
44
45CL_NS_DEF(search)
46 class Searcher;
47CL_NS_END
48CL_NS_USE(search)
49
50QT_BEGIN_NAMESPACE
51
52class QCLuceneHits;
53class QCLuceneSearcher;
54class QCLuceneIndexSearcher;
55class QCLuceneMultiSearcher;
56
57class QHELP_EXPORT QCLuceneSearchablePrivate : public QSharedData
58{
59public:
60 QCLuceneSearchablePrivate();
61 QCLuceneSearchablePrivate(const QCLuceneSearchablePrivate &other);
62
63 ~QCLuceneSearchablePrivate();
64
65 Searcher *searchable;
66 bool deleteCLuceneSearchable;
67
68private:
69 QCLuceneSearchablePrivate &operator=(const QCLuceneSearchablePrivate &other);
70};
71
72class QHELP_EXPORT QCLuceneSearchable
73{
74public:
75 virtual ~QCLuceneSearchable();
76
77protected:
78 friend class QCLuceneSearcher;
79 friend class QCLuceneIndexSearcher;
80 friend class QCLuceneMultiSearcher;
81 QSharedDataPointer<QCLuceneSearchablePrivate> d;
82
83private:
84 QCLuceneSearchable();
85};
86
87class QHELP_EXPORT QCLuceneSearcher : public QCLuceneSearchable
88{
89public:
90 QCLuceneSearcher();
91 virtual ~QCLuceneSearcher();
92
93 QCLuceneHits search(const QCLuceneQuery &query);
94 QCLuceneHits search(const QCLuceneQuery &query, const QCLuceneFilter &filter);
95 QCLuceneHits search(const QCLuceneQuery &query, const QCLuceneSort &sort);
96 QCLuceneHits search(const QCLuceneQuery &query, const QCLuceneFilter &filter,
97 const QCLuceneSort &sort);
98
99protected:
100 friend class QCLuceneHits;
101};
102
103class QHELP_EXPORT QCLuceneIndexSearcher : public QCLuceneSearcher
104{
105public:
106 QCLuceneIndexSearcher(const QString &path);
107 QCLuceneIndexSearcher(const QCLuceneIndexReader &reader);
108 ~QCLuceneIndexSearcher();
109
110 void close();
111 qint32 maxDoc() const;
112 QCLuceneIndexReader getReader();
113 bool doc(qint32 i, QCLuceneDocument &document);
114
115private:
116 QCLuceneIndexReader reader;
117};
118
119class QHELP_EXPORT QCLuceneMultiSearcher : public QCLuceneSearcher
120{
121public:
122 QCLuceneMultiSearcher(const QList<QCLuceneSearchable> searchables);
123 ~QCLuceneMultiSearcher();
124
125 void close();
126 qint32 maxDoc() const;
127 qint32 subDoc(qint32 index) const;
128 qint32 subSearcher(qint32 index) const;
129 qint32 searcherIndex(qint32 index) const;
130 bool doc(qint32 i, QCLuceneDocument &document);
131};
132
133QT_END_NAMESPACE
134
135#endif // QSEARCHABLE_P_H
Note: See TracBrowser for help on using the repository browser.