1 /***************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Qt Software Information (qt-info@nokia.com)
10 ** Non-Open Source Usage
12 ** Licensees may use this file in accordance with the Qt Beta Version
13 ** License Agreement, Agreement version 2.2 provided with the Software or,
14 ** alternatively, in accordance with the terms contained in a written
15 ** agreement between you and Nokia.
17 ** GNU General Public License Usage
19 ** Alternatively, this file may be used under the terms of the GNU General
20 ** Public License versions 2.0 or 3.0 as published by the Free Software
21 ** Foundation and appearing in the file LICENSE.GPL included in the packaging
22 ** of this file. Please review the following information to ensure GNU
23 ** General Public Licensing requirements will be met:
25 ** http://www.fsf.org/licensing/licenses/info/GPLv2.html and
26 ** http://www.gnu.org/copyleft/gpl.html.
28 ** In addition, as a special exception, Nokia gives you certain additional
29 ** rights. These rights are described in the Nokia Qt GPL Exception
30 ** version 1.3, included in the file GPL_EXCEPTION.txt in this package.
32 ***************************************************************************/
37 #include "ui_findwidget.h"
38 #include "ifindfilter.h"
39 #include "findtoolbar.h"
41 #include <extensionsystem/iplugin.h>
43 #include <QtCore/QHash>
44 #include <QtCore/QStringList>
45 #include <QtGui/QAction>
46 #include <QtGui/QTextDocument>
53 class FindPlugin : public ExtensionSystem::IPlugin
59 virtual ~FindPlugin();
62 bool initialize(const QStringList &arguments, QString *error_message);
63 void extensionsInitialized();
66 QTextDocument::FindFlags findFlags() const;
67 void updateFindCompletion(const QString &text);
68 void updateReplaceCompletion(const QString &text);
69 QStringListModel *findCompletionModel() { return m_findCompletionModel; }
70 QStringListModel *replaceCompletionModel() { return m_replaceCompletionModel; }
73 void setCaseSensitive(bool sensitive);
74 void setWholeWord(bool wholeOnly);
75 void setBackward(bool backward);
78 void findFlagsChanged();
82 void openFindFilter();
85 void setFindFlag(QTextDocument::FindFlag flag, bool enabled);
86 bool hasFindFlag(QTextDocument::FindFlag flag);
87 void updateCompletion(const QString &text, QStringList &completions, QStringListModel *model);
89 void setupFilterMenuItems();
94 QHash<IFindFilter *, QAction *> m_filterActions;
96 CurrentDocumentFind *m_currentDocumentFind;
97 FindToolBar *m_findToolBar;
98 FindToolWindow *m_findDialog;
99 QTextDocument::FindFlags m_findFlags;
100 QStringListModel *m_findCompletionModel;
101 QStringListModel *m_replaceCompletionModel;
102 QStringList m_findCompletions;
103 QStringList m_replaceCompletions;
106 } // namespace Internal
109 #endif // FINDPLUGIN_H