1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Qt Software Information (qt-info@nokia.com)
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.
16 ** GNU Lesser General Public License Usage
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.
25 ** If you are unsure which license is appropriate for your use, please
26 ** contact the sales department at qt-sales@nokia.com.
28 **************************************************************************/
33 #include "ifindfilter.h"
34 #include "findtoolbar.h"
36 #include <extensionsystem/iplugin.h>
38 #include <QtCore/QHash>
39 #include <QtCore/QStringList>
40 #include <QtGui/QAction>
41 #include <QtGui/QTextDocument>
48 class FindPlugin : public ExtensionSystem::IPlugin
54 virtual ~FindPlugin();
57 bool initialize(const QStringList &arguments, QString *error_message);
58 void extensionsInitialized();
61 QTextDocument::FindFlags findFlags() const;
62 void updateFindCompletion(const QString &text);
63 void updateReplaceCompletion(const QString &text);
64 QStringListModel *findCompletionModel() { return m_findCompletionModel; }
65 QStringListModel *replaceCompletionModel() { return m_replaceCompletionModel; }
68 void setCaseSensitive(bool sensitive);
69 void setWholeWord(bool wholeOnly);
70 void setBackward(bool backward);
73 void findFlagsChanged();
77 void openFindFilter();
80 void setFindFlag(QTextDocument::FindFlag flag, bool enabled);
81 bool hasFindFlag(QTextDocument::FindFlag flag);
82 void updateCompletion(const QString &text, QStringList &completions, QStringListModel *model);
84 void setupFilterMenuItems();
89 QHash<IFindFilter *, QAction *> m_filterActions;
91 CurrentDocumentFind *m_currentDocumentFind;
92 FindToolBar *m_findToolBar;
93 FindToolWindow *m_findDialog;
94 QTextDocument::FindFlags m_findFlags;
95 QStringListModel *m_findCompletionModel;
96 QStringListModel *m_replaceCompletionModel;
97 QStringList m_findCompletions;
98 QStringList m_replaceCompletions;
99 QAction *m_openFindDialog;
102 } // namespace Internal
105 #endif // FINDPLUGIN_H