util/tools/assistant/lib/fulltextsearch/qterm_p.h
changeset 7 f7bc934e204c
equal deleted inserted replaced
3:41300fa6a67c 7:f7bc934e204c
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team.
       
     4 ** All rights reserved.
       
     5 **
       
     6 ** Portion Copyright (C) 2010 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 QTERM_P_H
       
    19 #define QTERM_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 "qclucene_global_p.h"
       
    33 
       
    34 #include <QtCore/QSharedData>
       
    35 #include <QtCore/QString>
       
    36 #include <QtCore/QSharedDataPointer>
       
    37 
       
    38 CL_NS_DEF(index)
       
    39     class Term;
       
    40 CL_NS_END
       
    41 CL_NS_USE(index)
       
    42 
       
    43 QT_BEGIN_NAMESPACE
       
    44 
       
    45 class QCLuceneTermQuery;
       
    46 class QCLuceneRangeQuery;
       
    47 class QCLucenePrefixQuery;
       
    48 class QCLuceneIndexReader;
       
    49 class QCLucenePhraseQuery;
       
    50 
       
    51 class QHELP_EXPORT QCLuceneTermPrivate : public QSharedData
       
    52 {
       
    53 public:
       
    54     QCLuceneTermPrivate();
       
    55     QCLuceneTermPrivate(const QCLuceneTermPrivate &other);
       
    56 
       
    57     ~QCLuceneTermPrivate();
       
    58 
       
    59     Term *term;
       
    60     bool deleteCLuceneTerm;
       
    61 
       
    62 private:
       
    63     QCLuceneTermPrivate &operator=(const QCLuceneTermPrivate &other);
       
    64 };
       
    65 
       
    66 class QHELP_EXPORT QCLuceneTerm
       
    67 {
       
    68 public:
       
    69     QCLuceneTerm();
       
    70     QCLuceneTerm(const QString &field, const QString &text);
       
    71     QCLuceneTerm(const QCLuceneTerm &fieldTerm, const QString &text);
       
    72 
       
    73     virtual ~QCLuceneTerm();
       
    74 
       
    75     QString field() const;
       
    76 	QString text() const;
       
    77 	
       
    78 	void set(const QString &field, const QString &text);
       
    79 	void set(const QCLuceneTerm &fieldTerm, const QString &text);
       
    80 	void set(const QString &field, const QString &text, bool internField);
       
    81 
       
    82     bool equals(const QCLuceneTerm &other) const;
       
    83     qint32 compareTo(const QCLuceneTerm &other) const;
       
    84 	
       
    85 	QString toString() const;
       
    86 	quint32 hashCode() const;
       
    87     quint32 textLength() const;
       
    88 
       
    89 protected:
       
    90     friend class QCLuceneTermQuery;
       
    91     friend class QCLuceneRangeQuery;
       
    92     friend class QCLucenePrefixQuery;
       
    93     friend class QCLuceneIndexReader;
       
    94     friend class QCLucenePhraseQuery;
       
    95     QSharedDataPointer<QCLuceneTermPrivate> d;
       
    96 };
       
    97 
       
    98 QT_END_NAMESPACE
       
    99 
       
   100 #endif  // QTERM_P_H