KTextEditor

kateabstractinputmode.h
1/*
2 SPDX-FileCopyrightText: KDE Developers
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef KATE_ABSTRACT_INPUT_MODE_H
8#define KATE_ABSTRACT_INPUT_MODE_H
9
10class KateLayoutCache;
11class KateViewInternal;
12
13#include "ktexteditor/view.h"
14
15#include <QKeyEvent>
16
17class KateViewInternal;
18class KConfigGroup;
19class QKeyEvent;
20namespace KTextEditor
21{
22class ViewPrivate;
23enum class caretStyles;
24class Cursor;
25}
26
27class KateAbstractInputMode
28{
29protected:
30 KateAbstractInputMode(KateViewInternal *);
31
32public:
33 virtual ~KateAbstractInputMode() = default;
34
35 virtual KTextEditor::View::ViewMode viewMode() const = 0;
36 virtual QString viewModeHuman() const = 0;
37 virtual KTextEditor::View::InputMode viewInputMode() const = 0;
38 virtual QString viewInputModeHuman() const = 0;
39
40 virtual void activate() = 0;
41 virtual void deactivate() = 0;
42 virtual void reset() = 0;
43
44 virtual bool overwrite() const = 0;
45 virtual void overwrittenChar(const QChar &) = 0;
46 virtual void clearSelection() = 0;
47 virtual bool stealKey(QKeyEvent *k) = 0;
48
49 virtual void gotFocus() = 0;
50 virtual void lostFocus() = 0;
51
52 virtual void readSessionConfig(const KConfigGroup &config) = 0;
53 virtual void writeSessionConfig(KConfigGroup &config) = 0;
54 virtual void updateRendererConfig() = 0;
55 virtual void updateConfig() = 0;
56 virtual void readWriteChanged(bool rw) = 0;
57
58 virtual void find() = 0;
59 virtual void findSelectedForwards() = 0;
60 virtual void findSelectedBackwards() = 0;
61 virtual void findReplace() = 0;
62 virtual void findNext() = 0;
63 virtual void findPrevious() = 0;
64
65 virtual void activateCommandLine() = 0;
66
67 virtual bool keyPress(QKeyEvent *) = 0;
68 virtual bool blinkCaret() const = 0;
69 virtual KTextEditor::caretStyles caretStyle() const = 0;
70
71 virtual void toggleInsert() = 0;
72 virtual void launchInteractiveCommand(const QString &command) = 0;
73
74 virtual QString bookmarkLabel(int line) const = 0;
75
76 /* functions that are currently view private, but vi-mode needs to access them */
77public:
78 void updateCursor(const KTextEditor::Cursor newCursor);
79 KateLayoutCache *layoutCache() const;
80 int linesDisplayed() const;
81 void scrollViewLines(int offset);
82
83protected:
84 KateViewInternal *viewInternal() const
85 {
86 return m_viewInternal;
87 }
88 KTextEditor::ViewPrivate *view() const
89 {
90 return m_view;
91 }
92
93private:
94 KateViewInternal *m_viewInternal;
95 KTextEditor::ViewPrivate *m_view;
96};
97
98#endif
The Cursor represents a position in a Document.
Definition cursor.h:75
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
This class handles Kate's caching of layouting information (in KateLineLayout and KateTextLayout).
The KTextEditor namespace contains all the public API that is required to use the KTextEditor compone...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:11:27 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.