1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (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 http://qt.nokia.com/contact.
28 **************************************************************************/
33 #include "ui_findwidget.h"
34 #include "currentdocumentfind.h"
36 #include <utils/styledbar.h>
38 #include <QtCore/QTimer>
41 class FindToolBarPlaceHolder;
49 class FindToolBar : public Utils::StyledBar
54 explicit FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumentFind);
60 void openFindToolBar();
61 void setUseFakeVim(bool on);
64 void setBackward(bool backward);
67 void invokeFindNext();
68 void invokeFindPrevious();
69 void invokeFindStep();
71 void invokeReplaceNext();
72 void invokeReplacePrevious();
73 void invokeReplaceStep();
74 void invokeReplaceAll();
75 void invokeResetIncrementalSearch();
77 void invokeFindIncremental();
78 void invokeFindEnter();
79 void invokeReplaceEnter();
80 void putSelectionToFindClipboard();
81 void updateFromFindClipboard();
83 void hideAndResetFocus();
85 void updateFindAction();
87 void findFlagsChanged();
89 void setCaseSensitive(bool sensitive);
90 void setWholeWord(bool wholeOnly);
91 void setRegularExpressions(bool regexp);
93 void adaptToCandidate();
96 bool focusNextPrevChild(bool next);
99 void installEventFilters();
100 void invokeClearResults();
101 bool setFocusToCurrentFindSupport();
102 void setFindFlag(Find::FindFlag flag, bool enabled);
103 bool hasFindFlag(Find::FindFlag flag);
104 Find::FindFlags effectiveFindFlags();
105 Core::FindToolBarPlaceHolder *findToolBarPlaceHolder() const;
107 bool eventFilter(QObject *obj, QEvent *event);
108 void setFindText(const QString &text);
109 QString getFindText();
110 QString getReplaceText();
111 void selectFindText();
113 void updateFlagMenus();
115 FindPlugin *m_plugin;
116 CurrentDocumentFind *m_currentDocumentFind;
118 QCompleter *m_findCompleter;
119 QCompleter *m_replaceCompleter;
120 QAction *m_findInDocumentAction;
121 QAction *m_enterFindStringAction;
122 QAction *m_findNextAction;
123 QAction *m_findPreviousAction;
124 QAction *m_replaceAction;
125 QAction *m_replaceNextAction;
126 QAction *m_replacePreviousAction;
127 QAction *m_replaceAllAction;
128 QAction *m_caseSensitiveAction;
129 QAction *m_wholeWordAction;
130 QAction *m_regularExpressionAction;
131 Find::FindFlags m_findFlags;
133 QPixmap m_casesensitiveIcon;
134 QPixmap m_regexpIcon;
135 QPixmap m_wholewordsIcon;
137 QTimer m_findIncrementalTimer;
138 QTimer m_findStepTimer;
140 bool m_eventFiltersInstalled;
143 } // namespace Internal
146 #endif // FINDTOOLBAR_H