20 #ifndef KATEVIEMULATEDCOMMANDBAR_H
21 #define KATEVIEMULATEDCOMMANDBAR_H
32 class QStringListModel;
49 void setCommandResponseMessageTimeout(
long commandResponseMessageTimeOutMS);
51 bool handleKeyPress(
const QKeyEvent* keyEvent);
52 bool isSendingSyntheticSearchCompletedKeypress();
54 void startInteractiveSearchAndReplace(QSharedPointer<KateCommands::SedReplace::InteractiveSedReplacer> interactiveSedReplace);
61 QLabel *m_barTypeIndicator;
62 void showBarTypeIndicator(
Mode mode);
65 bool m_suspendEditEventFiltering;
66 bool m_waitingForRegister;
67 QLabel *m_waitingForRegisterIndicator;
68 bool m_insertedTextShouldBeEscapedForSearchingAsLiteral;
70 QTimer *m_commandResponseMessageDisplayHide;
71 QLabel* m_commandResponseMessageDisplay;
72 long m_commandResponseMessageTimeOutMS;
74 void switchToCommandResponseDisplay(
const QString& commandResponseMessage);
76 QLabel *m_interactiveSedReplaceLabel;
77 bool m_interactiveSedReplaceActive;
78 void updateInteractiveSedReplaceLabelText();
79 QSharedPointer<KateCommands::SedReplace::InteractiveSedReplacer> m_interactiveSedReplacer;
80 void finishInteractiveSedReplace();
84 QCompleter *m_completer;
85 QStringListModel *m_completionModel;
86 bool m_isNextTextChangeDueToCompletionChange;
87 enum CompletionType {
None, SearchHistory, WordFromDocument, Commands, CommandHistory, SedFindHistory, SedReplaceHistory };
88 CompletionType m_currentCompletionType;
89 void updateCompletionPrefix();
90 void currentCompletionChanged();
91 bool m_completionActive;
92 QString m_textToRevertToIfCompletionAborted;
93 int m_cursorPosToRevertToIfCompletionAborted;
98 enum BarBackgroundStatus { Normal, MatchFound, NoMatchFound };
99 void setBarBackground(BarBackgroundStatus status);
101 QString m_currentSearchPattern;
102 bool m_currentSearchIsCaseSensitive;
103 bool m_currentSearchIsBackwards;
104 bool m_currentSearchPlacesCursorAtEndOfMatch;
106 bool m_isSendingSyntheticSearchCompletedKeypress;
109 void deleteSpacesToLeftOfCursor();
110 void deleteWordCharsToLeftOfCursor();
111 bool deleteNonWordCharsToLeftOfCursor();
114 void replaceWordBeforeCursorWith(
const QString& newWord);
115 void replaceCommandBeforeCursorWith(
const QString& newCommand);
117 void activateSearchHistoryCompletion();
118 void activateWordFromDocumentCompletion();
119 void activateCommandCompletion();
120 void activateCommandHistoryCompletion();
121 void activateSedFindHistoryCompletion();
122 void activateSedReplaceHistoryCompletion();
123 void deactivateCompletion();
124 void abortCompletionAndResetToPreCompletion();
125 void setCompletionIndex(
int index);
132 struct ParsedSedExpression
134 bool parsedSuccessfully;
141 ParsedSedExpression parseAsSedExpression();
143 QString withSedReplaceTermReplacedWith(
const QString& newReplaceTerm);
148 bool isCursorInFindTermOfSed();
149 bool isCursorInReplaceTermOfSed();
155 QString withoutRangeExpression();
158 void editTextChanged(
const QString& newText);
159 void updateMatchHighlightAttrib();
160 void startHideCommandResponseTimer();
#define KATEPART_TESTS_EXPORT
A KateViewBarWidget that attempts to emulate some of the features of Vim's own command bar...