1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | ** Contact: Qt Software Information ([email protected])
|
---|
5 | **
|
---|
6 | ** This file is part of the QCLucene library and is distributable under
|
---|
7 | ** the terms of the LGPL license as specified in the license.txt file.
|
---|
8 | **
|
---|
9 | ****************************************************************************/
|
---|
10 |
|
---|
11 | #ifndef QDOCUMENT_P_H
|
---|
12 | #define QDOCUMENT_P_H
|
---|
13 |
|
---|
14 | //
|
---|
15 | // W A R N I N G
|
---|
16 | // -------------
|
---|
17 | //
|
---|
18 | // This file is not part of the Qt API. It exists for the convenience
|
---|
19 | // of the help generator tools. This header file may change from version
|
---|
20 | // to version without notice, or even be removed.
|
---|
21 | //
|
---|
22 | // We mean it.
|
---|
23 | //
|
---|
24 |
|
---|
25 | #include "qfield_p.h"
|
---|
26 | #include "qclucene_global_p.h"
|
---|
27 |
|
---|
28 | #include <QtCore/QList>
|
---|
29 | #include <QtCore/QString>
|
---|
30 | #include <QtCore/QStringList>
|
---|
31 | #include <QtCore/QSharedDataPointer>
|
---|
32 | #include <QtCore/QSharedData>
|
---|
33 |
|
---|
34 | CL_NS_DEF(document)
|
---|
35 | class Document;
|
---|
36 | CL_NS_END
|
---|
37 | CL_NS_USE(document)
|
---|
38 |
|
---|
39 | QT_BEGIN_NAMESPACE
|
---|
40 |
|
---|
41 | class QCLuceneHits;
|
---|
42 | class QCLuceneIndexReader;
|
---|
43 | class QCLuceneIndexWriter;
|
---|
44 | class QCLuceneIndexSearcher;
|
---|
45 | class QCLuceneMultiSearcher;
|
---|
46 |
|
---|
47 | class QHELP_EXPORT QCLuceneDocumentPrivate : public QSharedData
|
---|
48 | {
|
---|
49 | public:
|
---|
50 | QCLuceneDocumentPrivate();
|
---|
51 | QCLuceneDocumentPrivate(const QCLuceneDocumentPrivate &other);
|
---|
52 |
|
---|
53 | ~QCLuceneDocumentPrivate();
|
---|
54 |
|
---|
55 | Document *document;
|
---|
56 | bool deleteCLuceneDocument;
|
---|
57 |
|
---|
58 | private:
|
---|
59 | QCLuceneDocumentPrivate &operator=(const QCLuceneDocumentPrivate &other);
|
---|
60 | };
|
---|
61 |
|
---|
62 | class QHELP_EXPORT QCLuceneDocument
|
---|
63 | {
|
---|
64 | public:
|
---|
65 | QCLuceneDocument();
|
---|
66 | ~QCLuceneDocument();
|
---|
67 |
|
---|
68 | void add(QCLuceneField *field);
|
---|
69 | QCLuceneField* getField(const QString &name) const;
|
---|
70 | QString get(const QString &name) const;
|
---|
71 | QString toString() const;
|
---|
72 | void setBoost(qreal boost);
|
---|
73 | qreal getBoost() const;
|
---|
74 | void removeField(const QString &name);
|
---|
75 | void removeFields(const QString &name);
|
---|
76 | QStringList getValues(const QString &name) const;
|
---|
77 | void clear();
|
---|
78 |
|
---|
79 | protected:
|
---|
80 | friend class QCLuceneHits;
|
---|
81 | friend class QCLuceneIndexReader;
|
---|
82 | friend class QCLuceneIndexWriter;
|
---|
83 | friend class QCLuceneIndexSearcher;
|
---|
84 | friend class QCLuceneMultiSearcher;
|
---|
85 | QSharedDataPointer<QCLuceneDocumentPrivate> d;
|
---|
86 |
|
---|
87 | private:
|
---|
88 | mutable QList<QCLuceneField*> fieldList;
|
---|
89 | };
|
---|
90 |
|
---|
91 | QT_END_NAMESPACE
|
---|
92 |
|
---|
93 | #endif // QDOCUMENT_P_H
|
---|