| 1 | /* |
| 2 | SPDX-FileCopyrightText: KDE Developers |
| 3 | |
| 4 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 5 | */ |
| 6 | |
| 7 | #ifndef KATEVI_JUMPS_H |
| 8 | #define KATEVI_JUMPS_H |
| 9 | |
| 10 | #include <ktexteditor/cursor.h> |
| 11 | |
| 12 | #include <KConfigGroup> |
| 13 | |
| 14 | #include <QList> |
| 15 | |
| 16 | namespace KateVi |
| 17 | { |
| 18 | class Jumps |
| 19 | { |
| 20 | public: |
| 21 | explicit Jumps() = default; |
| 22 | ~Jumps() = default; |
| 23 | |
| 24 | Jumps(const Jumps &) = delete; |
| 25 | Jumps &operator=(const Jumps &) = delete; |
| 26 | |
| 27 | void add(const KTextEditor::Cursor cursor); |
| 28 | KTextEditor::Cursor next(const KTextEditor::Cursor cursor); |
| 29 | KTextEditor::Cursor prev(const KTextEditor::Cursor cursor); |
| 30 | |
| 31 | void writeSessionConfig(KConfigGroup &config) const; |
| 32 | void readSessionConfig(const KConfigGroup &config); |
| 33 | |
| 34 | private: |
| 35 | QList<KTextEditor::Cursor> m_jumps; |
| 36 | QList<KTextEditor::Cursor>::iterator m_current = m_jumps.begin(); |
| 37 | }; |
| 38 | |
| 39 | } |
| 40 | |
| 41 | #endif // KATEVI_JUMPS_H |
| 42 | |