KTextEditor

kateviinputmode.h
1 /*
2  SPDX-FileCopyrightText: KDE Developers
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef KATE_VI_INPUT_MODE_H
8 #define KATE_VI_INPUT_MODE_H
9 
10 #include "kateabstractinputmode.h"
11 
12 namespace KateVi
13 {
14 class GlobalState;
15 class InputModeManager;
16 class EmulatedCommandBar;
17 }
18 class KateViInputModeFactory;
19 
20 class KTEXTEDITOR_EXPORT KateViInputMode : public KateAbstractInputMode
21 {
22  explicit KateViInputMode(KateViewInternal *viewInternal, KateVi::GlobalState *global);
23  friend KateViInputModeFactory;
24 
25 public:
26  ~KateViInputMode() override;
27 
28  KTextEditor::View::ViewMode viewMode() const override;
29  QString viewModeHuman() const override;
30  KTextEditor::View::InputMode viewInputMode() const override;
31  QString viewInputModeHuman() const override;
32 
33  void activate() override;
34  void deactivate() override;
35  void reset() override;
36 
37  bool overwrite() const override;
38  void overwrittenChar(const QChar &) override;
39 
40  void clearSelection() override;
41  bool stealKey(QKeyEvent *) override;
42 
43  void gotFocus() override;
44  void lostFocus() override;
45 
46  void readSessionConfig(const KConfigGroup &config) override;
47  void writeSessionConfig(KConfigGroup &config) override;
48  void updateRendererConfig() override;
49  void updateConfig() override;
50  void readWriteChanged(bool rw) override;
51 
52  void find() override;
53  void findSelectedForwards() override;
54  void findSelectedBackwards() override;
55  void findReplace() override;
56  void findNext() override;
57  void findPrevious() override;
58 
59  void activateCommandLine() override;
60 
61  bool keyPress(QKeyEvent *) override;
62  bool blinkCaret() const override;
63  KateRenderer::caretStyles caretStyle() const override;
64 
65  void toggleInsert() override;
66  void launchInteractiveCommand(const QString &command) override;
67 
68  QString bookmarkLabel(int line) const override;
69 
70 public:
71  void showViModeEmulatedCommandBar();
72  KateVi::EmulatedCommandBar *viModeEmulatedCommandBar();
73  inline KateVi::GlobalState *globalState() const
74  {
75  return m_viGlobal;
76  }
77  inline KateVi::InputModeManager *viInputModeManager() const
78  {
79  return m_viModeManager;
80  }
81  inline bool isActive() const
82  {
83  return m_activated;
84  }
85  void setCaretStyle(const KateRenderer::caretStyles caret);
86 
87 private:
88  KateVi::InputModeManager *m_viModeManager;
89  KateVi::EmulatedCommandBar *m_viModeEmulatedCommandBar;
90  KateVi::GlobalState *m_viGlobal;
92 
93  bool m_nextKeypressIsOverriddenShortCut;
94 
95  // configs
96  bool m_relLineNumbers;
97  bool m_activated;
98 };
99 
100 #endif
StandardShortcut find(const QKeySequence &keySeq)
KGuiItem overwrite()
const QList< QKeySequence > & findNext()
void keyPress(QWindow *window, char key, Qt::KeyboardModifiers modifier, int delay)
ViewMode
Possible view modes These correspond to various modes the text editor might be in.
Definition: view.h:195
caretStyles
Style of Caret.
Definition: katerenderer.h:64
InputMode
Possible input modes.
Definition: view.h:186
A KateViewBarWidget that attempts to emulate some of the features of Vim&#39;s own command bar...
KGuiItem reset()
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Nov 27 2020 22:59:32 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.