22 #ifndef KATE_SEARCH_BAR_H
23 #define KATE_SEARCH_BAR_H 1
28 #include <ktexteditor/attribute.h>
29 #include <ktexteditor/messageinterface.h>
30 #include <ktexteditor/searchinterface.h>
38 class IncrementalSearchBar;
42 namespace KTextEditor {
50 friend class SearchBarTest;
58 MODE_ESCAPE_SEQUENCES = 2,
85 QString replacementPattern()
const;
87 bool selectionOnly()
const;
88 bool matchCase()
const;
91 static void nextMatchForSelection(
KateView * view, SearchDirection searchDirection);
100 void setSearchPattern(
const QString &searchPattern);
106 void setReplacementPattern(
const QString &replacementPattern);
108 void setSearchMode(SearchMode mode);
109 void setSelectionOnly(
bool selectionOnly);
110 void setMatchCase(
bool matchCase);
121 void enterPowerMode();
122 void enterIncrementalMode();
124 bool clearHighlights();
125 void updateHighlightColors();
128 void slotReadWriteChanged ();
135 void onIncPatternChanged(
const QString & pattern);
136 void onMatchCaseToggled(
bool matchCase);
138 void onReturnPressed();
139 void updateSelectionOnly();
140 void updateIncInitCursor();
142 void onPowerPatternChanged(
const QString & pattern);
144 void onPowerModeChanged(
int index);
145 void onPowerPatternContextMenuRequest();
146 void onPowerPatternContextMenuRequest(
const QPoint&);
147 void onPowerReplacmentContextMenuRequest();
148 void onPowerReplacmentContextMenuRequest(
const QPoint&);
152 bool find(SearchDirection searchDirection = SearchForward,
const QString * replacement = 0);
153 int findAll(KTextEditor::Range inputRange,
const QString * replacement);
155 bool isPatternValid()
const;
157 KTextEditor::Search::SearchOptions searchOptions(SearchDirection searchDirection = SearchForward)
const;
159 void highlightMatch(
const KTextEditor::Range & range);
160 void highlightReplacement(
const KTextEditor::Range & range);
161 void indicateMatch(MatchResult matchResult);
162 static void selectRange(
KateView * view,
const KTextEditor::Range & range);
163 void selectRange2(
const KTextEditor::Range & range);
166 void showExtendedContextMenu(
bool forPattern,
const QPoint& pos);
168 void givePatternFeedback();
169 void addCurrentTextToHistory(
QComboBox * combo);
170 void backupConfig(
bool ofPower);
172 void fixForSingleLine(KTextEditor::Range & range, SearchDirection searchDirection);
180 KTextEditor::Message::MessageType type, KTextEditor::Message::MessagePosition position,
181 KTextEditor::Message::AutoHideMode autoHideMode,
int durationMs,
bool blink);
183 void showInfoMessage(
const QString& text);
199 Ui::IncrementalSearchBar * m_incUi;
200 KTextEditor::Cursor m_incInitCursor;
203 Ui::PowerSearchBar * m_powerUi;
206 KTextEditor::Attribute::Ptr highlightMatchAttribute;
207 KTextEditor::Attribute::Ptr highlightReplacementAttribute;
210 bool m_incHighlightAll : 1;
211 bool m_incFromCursor : 1;
212 bool m_incMatchCase : 1;
213 bool m_powerMatchCase : 1;
214 bool m_powerFromCursor : 1;
215 bool m_powerHighlightAll : 1;
216 unsigned int m_powerMode : 2;
217 bool m_unitTestMode :1 ;
222 #endif // KATE_SEARCH_BAR_H
void enableUnitTestMode()
#define KATEPART_TESTS_EXPORT