KTextEditor

marks.h
1/*
2 SPDX-FileCopyrightText: KDE Developers
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef KATE_VIMODE_MARKS_H
8#define KATE_VIMODE_MARKS_H
9
10#include <KConfigGroup>
11#include <KTextEditor/Document>
12
13#include <QMap>
14
15namespace KTextEditor
16{
17class DocumentPrivate;
18class Cursor;
19class MovingCursor;
20}
21
22namespace KateVi
23{
24class InputModeManager;
25
26class Marks : public QObject
27{
28public:
29 explicit Marks(InputModeManager *imm);
30
31 /** JBOS == Just a Bunch Of Shortcuts **/
32 void setStartEditYanked(const KTextEditor::Cursor pos);
33 void setFinishEditYanked(const KTextEditor::Cursor pos);
34 void setLastChange(const KTextEditor::Cursor pos);
35 void setInsertStopped(const KTextEditor::Cursor pos);
36 void setSelectionStart(const KTextEditor::Cursor pos);
37 void setSelectionFinish(const KTextEditor::Cursor pos);
38 void setUserMark(const QChar &mark, const KTextEditor::Cursor pos);
39
40 KTextEditor::Cursor getStartEditYanked() const;
41 KTextEditor::Cursor getFinishEditYanked() const;
42 KTextEditor::Cursor getLastChange() const;
43 KTextEditor::Cursor getInsertStopped() const;
44 KTextEditor::Cursor getSelectionStart() const;
45 KTextEditor::Cursor getSelectionFinish() const;
46 KTextEditor::Cursor getMarkPosition(const QChar &mark) const;
47
48 void writeSessionConfig(KConfigGroup &config) const;
49 void readSessionConfig(const KConfigGroup &config);
50
51 QString getMarksOnTheLine(int line) const;
52
53private:
54 void syncViMarksAndBookmarks();
55 static bool isShowable(const QChar &mark);
56
57 void setMark(const QChar &mark, const KTextEditor::Cursor pos);
58
59private:
60 void markChanged(KTextEditor::Document *doc, KTextEditor::Mark mark, KTextEditor::Document::MarkChangeAction action);
61
62private:
63 InputModeManager *m_inputModeManager;
64 KTextEditor::DocumentPrivate *m_doc;
65
66 QMap<QChar, KTextEditor::MovingCursor *> m_marks;
67 bool m_settingMark;
68};
69}
70
71#endif // KATE_VIMODE_MARKS_H
The Cursor represents a position in a Document.
Definition cursor.h:75
Backend of KTextEditor::Document related public KTextEditor interfaces.
MarkChangeAction
Possible actions on a mark.
Definition document.h:1664
A Cursor which is bound to a specific Document, and maintains its position.
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-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:55:25 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.