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 | |
13 | namespace KTextEditor |
14 | { |
15 | class ViewPrivate; |
16 | } |
17 | |
18 | class KToggleAction; |
19 | class KActionCollection; |
20 | class ; |
21 | class QAction; |
22 | |
23 | class KateBookmarks : public QObject |
24 | { |
25 | public: |
26 | enum Sorting { |
27 | Position, |
28 | Creation |
29 | }; |
30 | explicit KateBookmarks(KTextEditor::ViewPrivate *parent, Sorting sort = Position); |
31 | ~KateBookmarks() override; |
32 | |
33 | void createActions(KActionCollection *); |
34 | |
35 | KateBookmarks::Sorting sorting() |
36 | { |
37 | return m_sorting; |
38 | } |
39 | void setSorting(Sorting s) |
40 | { |
41 | m_sorting = s; |
42 | } |
43 | |
44 | void setCycleThroughBookmarks(bool e) |
45 | { |
46 | m_cycleThroughBookmarks = e; |
47 | } |
48 | |
49 | protected: |
50 | void (QMenu &); |
51 | |
52 | private: |
53 | void toggleBookmark(); |
54 | void clearBookmarks(); |
55 | |
56 | void gotoLine(int line); |
57 | |
58 | void (); |
59 | |
60 | void goNext(); |
61 | void goPrevious(); |
62 | |
63 | void marksChanged(); |
64 | |
65 | private: |
66 | KTextEditor::ViewPrivate *m_view; |
67 | QAction *m_bookmarkToggle; |
68 | QAction *m_bookmarkClear; |
69 | QAction *m_goNext; |
70 | QAction *m_goPrevious; |
71 | |
72 | Sorting m_sorting; |
73 | QMenu *; |
74 | |
75 | uint _tries; |
76 | bool m_cycleThroughBookmarks = true; |
77 | }; |
78 | |
79 | #endif |
80 | |