1/*
2 SPDX-FileCopyrightText: 2002, 2003, 2004 Anders Lund <anders.lund@lund.tdcadsl.dk>
3 SPDX-FileCopyrightText: 2002 John Firebaugh <jfirebaugh@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef KATE_BOOKMARKS_H
9#define KATE_BOOKMARKS_H
10
11#include <QObject>
12
13namespace KTextEditor
14{
15class ViewPrivate;
16}
17
18class KToggleAction;
19class KActionCollection;
20class QMenu;
21class QAction;
22
23class KateBookmarks : public QObject
24{
25public:
26 enum Sorting { Position, Creation };
27 explicit KateBookmarks(KTextEditor::ViewPrivate *parent, Sorting sort = Position);
28 ~KateBookmarks() override;
29
30 void createActions(KActionCollection *);
31
32 KateBookmarks::Sorting sorting()
33 {
34 return m_sorting;
35 }
36 void setSorting(Sorting s)
37 {
38 m_sorting = s;
39 }
40
41protected:
42 void insertBookmarks(QMenu &menu);
43
44private:
45 void toggleBookmark();
46 void clearBookmarks();
47
48 void gotoLine(int line);
49
50 void bookmarkMenuAboutToShow();
51
52 void goNext();
53 void goPrevious();
54
55 void marksChanged();
56
57private:
58 KTextEditor::ViewPrivate *m_view;
59 KToggleAction *m_bookmarkToggle;
60 QAction *m_bookmarkClear;
61 QAction *m_goNext;
62 QAction *m_goPrevious;
63
64 Sorting m_sorting;
65 QMenu *m_bookmarksMenu;
66
67 uint _tries;
68};
69
70#endif
71

source code of ktexteditor/src/utils/katebookmarks.h