libquentier 0.8.0
The library for rich desktop clients of Evernote service
Loading...
Searching...
No Matches
ShortcutManager.h
1/*
2 * Copyright 2016-2024 Dmitry Ivanov
3 *
4 * This file is part of libquentier
5 *
6 * libquentier is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, version 3 of the License.
9 *
10 * libquentier is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with libquentier. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#pragma once
20
21#include <quentier/types/Account.h>
22#include <quentier/utility/Linkage.h>
23
24#include <QKeySequence>
25#include <QObject>
26
27namespace quentier {
28
29QT_FORWARD_DECLARE_CLASS(ShortcutManagerPrivate)
30
32{
34public:
35 explicit ShortcutManager(QObject * parent = nullptr);
36
37 enum QuentierShortcutKey
38 {
39 NewNote = 5000,
40 NewTag,
41 NewNotebook,
42 NewSavedSearch,
43 AddAttachment,
44 SaveAttachment,
45 OpenAttachment,
46 CopyAttachment,
47 CutAttachment,
48 RemoveAttachment,
49 RenameAttachment,
50 AddAccount,
51 ExitAccount,
52 SwitchAccount,
53 AccountInfo,
54 NoteSearch,
55 NewNoteSearch,
56 ShowNotes,
57 ShowNotebooks,
58 ShowTags,
59 ShowSavedSearches,
60 ShowDeletedNotes,
61 ShowStatusBar,
62 ShowToolBar,
63 PasteUnformatted,
64 Font,
65 UpperIndex,
66 LowerIndex,
67 AlignLeft,
68 AlignCenter,
69 AlignRight,
70 AlignFull,
71 IncreaseIndentation,
72 DecreaseIndentation,
73 IncreaseFontSize,
74 DecreaseFontSize,
75 InsertNumberedList,
76 InsertBulletedList,
77 Strikethrough,
78 Highlight,
79 InsertTable,
80 InsertRow,
81 InsertColumn,
82 RemoveRow,
83 RemoveColumn,
84 InsertHorizontalLine,
85 InsertToDoTag,
86 EditHyperlink,
87 CopyHyperlink,
88 RemoveHyperlink,
89 Encrypt,
90 Decrypt,
91 DecryptPermanently,
92 BackupLocalStorage,
93 RestoreLocalStorage,
94 UpgradeLocalStorage,
95 LocalStorageStatus,
96 SpellCheck,
97 SpellCheckIgnoreWord,
98 SpellCheckAddWordToUserDictionary,
99 SaveImage,
100 AnnotateImage,
101 ImageRotateClockwise,
102 ImageRotateCounterClockwise,
103 Synchronize,
104 FullSync,
105 ImportFolders,
106 Preferences,
107 ReleaseNotes,
108 ViewLogs,
109 About,
110 UnknownKey = 100000
111 };
112
119 int key, const Account & account, const QString & context = {}) const;
120
127 const QString & nonStandardKey, const Account & account,
128 const QString & context = {}) const;
129
135 int key, const Account & account, const QString & context = {}) const;
136
142 const QString & nonStandardKey, const Account & account,
143 const QString & context = {}) const;
144
150 int key, const Account & account, const QString & context = {}) const;
151
157 const QString & nonStandardKey, const Account & account,
158 const QString & context = {}) const;
159
161 void shortcutChanged(
162 int key, QKeySequence shortcut, const Account & account,
164
165 void nonStandardShortcutChanged(
168
169public Q_SLOTS:
170 void setUserShortcut(
171 int key, QKeySequence shortcut, const Account & account,
172 QString context = {});
173
174 void setNonStandardUserShortcut(
175 QString nonStandardKey, QKeySequence shortcut, const Account & account,
176 QString context = {});
177
178 void setDefaultShortcut(
179 int key, QKeySequence shortcut, const Account & account,
180 QString context = {});
181
182 void setNonStandardDefaultShortcut(
183 QString nonStandardKey, QKeySequence shortcut, const Account & account,
184 QString context = {});
185
186private:
187 ShortcutManagerPrivate * const d_ptr;
188 Q_DECLARE_PRIVATE(ShortcutManager)
189};
190
191} // namespace quentier
The Account class encapsulates some details about the account: its name, whether it is local or synch...
Definition Account.h:38
The Result template class represents the bare bones result monad implementation which either contains...
Definition Result.h:38
Definition ShortcutManager.h:32
QKeySequence shortcut(int key, const Account &account, const QString &context={}) const
QKeySequence defaultShortcut(int key, const Account &account, const QString &context={}) const
QKeySequence userShortcut(const QString &nonStandardKey, const Account &account, const QString &context={}) const
QKeySequence shortcut(const QString &nonStandardKey, const Account &account, const QString &context={}) const
QKeySequence userShortcut(int key, const Account &account, const QString &context={}) const
QKeySequence defaultShortcut(const QString &nonStandardKey, const Account &account, const QString &context={}) const