KTextEditor

kateviinputmode.h
1 /* SPDX-License-Identifier: LGPL-2.0-or-later
2 
3  Copyright (C) KDE Developers
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef KATE_VI_INPUT_MODE_H
22 #define KATE_VI_INPUT_MODE_H
23 
24 #include "kateabstractinputmode.h"
25 
26 namespace KateVi
27 {
28 class GlobalState;
29 class InputModeManager;
30 class EmulatedCommandBar;
31 }
32 class KateViInputModeFactory;
33 
34 class KTEXTEDITOR_EXPORT KateViInputMode : public KateAbstractInputMode
35 {
36  explicit KateViInputMode(KateViewInternal *viewInternal, KateVi::GlobalState *global);
37  friend KateViInputModeFactory;
38 
39 public:
40  ~KateViInputMode() override;
41 
42  KTextEditor::View::ViewMode viewMode() const override;
43  QString viewModeHuman() const override;
44  KTextEditor::View::InputMode viewInputMode() const override;
45  QString viewInputModeHuman() const override;
46 
47  void activate() override;
48  void deactivate() override;
49  void reset() override;
50 
51  bool overwrite() const override;
52  void overwrittenChar(const QChar &) override;
53 
54  void clearSelection() override;
55  bool stealKey(QKeyEvent *) override;
56 
57  void gotFocus() override;
58  void lostFocus() override;
59 
60  void readSessionConfig(const KConfigGroup &config) override;
61  void writeSessionConfig(KConfigGroup &config) override;
62  void updateRendererConfig() override;
63  void updateConfig() override;
64  void readWriteChanged(bool rw) override;
65 
66  void find() override;
67  void findSelectedForwards() override;
68  void findSelectedBackwards() override;
69  void findReplace() override;
70  void findNext() override;
71  void findPrevious() override;
72 
73  void activateCommandLine() override;
74 
75  bool keyPress(QKeyEvent *) override;
76  bool blinkCaret() const override;
77  KateRenderer::caretStyles caretStyle() const override;
78 
79  void toggleInsert() override;
80  void launchInteractiveCommand(const QString &command) override;
81 
82  QString bookmarkLabel(int line) const override;
83 
84 public:
85  void showViModeEmulatedCommandBar();
86  KateVi::EmulatedCommandBar *viModeEmulatedCommandBar();
87  inline KateVi::GlobalState *globalState() const
88  {
89  return m_viGlobal;
90  }
91  inline KateVi::InputModeManager *viInputModeManager() const
92  {
93  return m_viModeManager;
94  }
95  inline bool isActive() const
96  {
97  return m_activated;
98  }
99  void setCaretStyle(const KateRenderer::caretStyles caret);
100 
101 private:
102  KateVi::InputModeManager *m_viModeManager;
103  KateVi::EmulatedCommandBar *m_viModeEmulatedCommandBar;
104  KateVi::GlobalState *m_viGlobal;
106 
107  bool m_nextKeypressIsOverriddenShortCut;
108 
109  // configs
110  bool m_relLineNumbers;
111  bool m_activated;
112 };
113 
114 #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:205
caretStyles
Style of Caret.
Definition: katerenderer.h:75
InputMode
Possible input modes.
Definition: view.h:196
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 Tue May 26 2020 23:11:05 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.