File: jumps.h

package info (click to toggle)
kf6-ktexteditor 6.23.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 41,676 kB
  • sloc: cpp: 93,343; javascript: 20,925; xml: 237; sh: 20; ansic: 16; makefile: 8
file content (41 lines) | stat: -rw-r--r-- 843 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
    SPDX-FileCopyrightText: KDE Developers

    SPDX-License-Identifier: LGPL-2.0-or-later
*/

#ifndef KATEVI_JUMPS_H
#define KATEVI_JUMPS_H

#include <ktexteditor/cursor.h>

#include <KConfigGroup>

#include <QList>

namespace KateVi
{
class Jumps
{
public:
    explicit Jumps() = default;
    ~Jumps() = default;

    Jumps(const Jumps &) = delete;
    Jumps &operator=(const Jumps &) = delete;

    void add(const KTextEditor::Cursor cursor);
    KTextEditor::Cursor next(const KTextEditor::Cursor cursor);
    KTextEditor::Cursor prev(const KTextEditor::Cursor cursor);

    void writeSessionConfig(KConfigGroup &config) const;
    void readSessionConfig(const KConfigGroup &config);

private:
    QList<KTextEditor::Cursor> m_jumps;
    QList<KTextEditor::Cursor>::iterator m_current = m_jumps.begin();
};

}

#endif // KATEVI_JUMPS_H