OSDN Git Service

Support symbolic links in the file manager.
[qt-creator-jp/qt-creator-jp.git] / src / plugins / find / ifindsupport.h
1 /**************************************************************************
2 **
3 ** This file is part of Qt Creator
4 **
5 ** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
6 **
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
8 **
9 ** Commercial Usage
10 **
11 ** Licensees holding valid Qt Commercial licenses may use this file in
12 ** accordance with the Qt Commercial License Agreement provided with the
13 ** Software or, alternatively, in accordance with the terms contained in
14 ** a written agreement between you and Nokia.
15 **
16 ** GNU Lesser General Public License Usage
17 **
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file.  Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** If you are unsure which license is appropriate for your use, please
26 ** contact the sales department at http://qt.nokia.com/contact.
27 **
28 **************************************************************************/
29
30 #ifndef IFINDSUPPORT_H
31 #define IFINDSUPPORT_H
32
33 #include "find_global.h"
34 #include "textfindconstants.h"
35
36 #include <QtCore/QObject>
37 #include <QtCore/QString>
38 #include <QtGui/QTextDocument>
39
40 namespace Find {
41
42 class FIND_EXPORT IFindSupport : public QObject
43 {
44     Q_OBJECT
45
46 public:
47     enum Result { Found, NotFound, NotYetFound };
48
49     IFindSupport() : QObject(0) {}
50     virtual ~IFindSupport() {}
51
52     virtual bool supportsReplace() const = 0;
53     virtual FindFlags supportedFindFlags() const = 0;
54     virtual void resetIncrementalSearch() = 0;
55     virtual void clearResults() = 0;
56     virtual QString currentFindString() const = 0;
57     virtual QString completedFindString() const = 0;
58
59     virtual void highlightAll(const QString &txt, FindFlags findFlags);
60     virtual Result findIncremental(const QString &txt, FindFlags findFlags) = 0;
61     virtual Result findStep(const QString &txt, FindFlags findFlags) = 0;
62     virtual void replace(const QString &before, const QString &after,
63                          FindFlags findFlags) = 0;
64     virtual bool replaceStep(const QString &before, const QString &after,
65         FindFlags findFlags) = 0;
66     virtual int replaceAll(const QString &before, const QString &after,
67         FindFlags findFlags) = 0;
68
69     virtual void defineFindScope(){}
70     virtual void clearFindScope(){}
71
72 signals:
73     void changed();
74 };
75
76 inline void IFindSupport::highlightAll(const QString &, FindFlags) {}
77
78 } // namespace Find
79
80 #endif // IFINDSUPPORT_H