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 <memory>
11
12#include "kateabstractinputmode.h"
13
14#include <vimode/inputmodemanager.h>
15
16namespace KateVi
17{
18class GlobalState;
19class EmulatedCommandBar;
20}
21class KateViInputModeFactory;
22
23class KTEXTEDITOR_EXPORT KateViInputMode : public KateAbstractInputMode
24{
25 explicit KateViInputMode(KateViewInternal *viewInternal, KateVi::GlobalState *global);
26 friend KateViInputModeFactory;
27
28public:
29 KTextEditor::View::ViewMode viewMode() const override;
30 QString viewModeHuman() const override;
31 KTextEditor::View::InputMode viewInputMode() const override;
32 QString viewInputModeHuman() const override;
33
34 void activate() override;
35 void deactivate() override;
36 void reset() override;
37
38 bool overwrite() const override;
39 void overwrittenChar(const QChar &) override;
40
41 void clearSelection() override;
42 bool stealKey(QKeyEvent *) override;
43
44 void gotFocus() override;
45 void lostFocus() override;
46
47 void readSessionConfig(const KConfigGroup &config) override;
48 void writeSessionConfig(KConfigGroup &config) override;
49 void updateRendererConfig() override;
50 void updateConfig() override;
51 void readWriteChanged(bool rw) override;
52
53 void find() override;
54 void findSelectedForwards() override;
55 void findSelectedBackwards() override;
56 void findReplace() override;
57 void findNext() override;
58 void findPrevious() override;
59
60 void activateCommandLine() override;
61
62 bool keyPress(QKeyEvent *) override;
63 bool blinkCaret() const override;
64 KTextEditor::caretStyles caretStyle() const override;
65
66 void toggleInsert() override;
67 void launchInteractiveCommand(const QString &command) override;
68
69 QString bookmarkLabel(int line) const override;
70
71public:
72 void showViModeEmulatedCommandBar();
73 KateVi::EmulatedCommandBar *viModeEmulatedCommandBar();
74 inline KateVi::GlobalState *globalState() const
75 {
76 return m_viGlobal;
77 }
78 inline KateVi::InputModeManager *viInputModeManager() const
79 {
80 return m_viModeManager.get();
81 }
82 inline bool isActive() const
83 {
84 return m_activated;
85 }
86 void setCaretStyle(const KTextEditor::caretStyles caret);
87
88private:
89 KateVi::EmulatedCommandBar *m_viModeEmulatedCommandBar;
90 KateVi::GlobalState *m_viGlobal;
91 KTextEditor::caretStyles m_caret;
92
93 bool m_nextKeypressIsOverriddenShortCut;
94
95 // configs
96 bool m_relLineNumbers;
97 bool m_activated;
98
99 std::unique_ptr<KateVi::InputModeManager> m_viModeManager;
100};
101
102#endif
ViewMode
Possible view modes These correspond to various modes the text editor might be in.
Definition view.h:295
InputMode
Possible input modes.
Definition view.h:286
A KateViewBarWidget that attempts to emulate some of the features of Vim's own command bar,...
KGuiItem reset()
KGuiItem overwrite()
const QList< QKeySequence > & find()
const QList< QKeySequence > & findNext()
void keyPress(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier, int delay)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:56 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.