Sayonara Player
Loading...
Searching...
No Matches
ShortcutHandler.h
1/* ShortcutHandler.h */
2
3/* Copyright (C) 2011-2024 Michael Lugmair (Lucio Carreras)
4 *
5 * This file is part of sayonara player
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef SHORTCUTHANDLER_H
22#define SHORTCUTHANDLER_H
23
24#include "ShortcutIdentifier.h"
25#include "Utils/Singleton.h"
26#include "Utils/Pimpl.h"
27
28#include <QShortcut>
29#include <QObject>
30
31class Shortcut;
32
33#define ShortcutPrivate private
34
40 public QObject
41{
42 Q_OBJECT
43 SINGLETON(ShortcutHandler)
44 PIMPL(ShortcutHandler)
45
46 friend class Shortcut;
47
48 ShortcutPrivate:
49 void qtShortcutsAdded(ShortcutIdentifier databaseKey, const QList<QShortcut*>& qtShortcuts);
50
51 signals:
52 void sigShortcutChanged(ShortcutIdentifier databaseKey);
53
54 public:
60 Shortcut shortcut(ShortcutIdentifier databaseKey) const;
61
67 void setShortcut(ShortcutIdentifier databaseKey, const QStringList& shortcut);
68
74
75 QString databaseKey(ShortcutIdentifier id) const;
76 QString shortcut_text(ShortcutIdentifier id) const;
77
78 private slots:
79 void qtShortcutDestroyed();
80};
81
82#endif // SHORTCUTHANDLER_H
Definition: EngineUtils.h:33
A singleton class for retrieving shortcuts.
Definition: ShortcutHandler.h:41
void setShortcut(ShortcutIdentifier databaseKey, const QStringList &shortcut)
set the shortcut by its unique identifier
QList< ShortcutIdentifier > allIdentifiers() const
get all shortcuts
Shortcut shortcut(ShortcutIdentifier databaseKey) const
get a shortcut by its unique identifier
A single shortcut managed by ShortcutHandler. This class holds information about the default shortcut...
Definition: Shortcut.h:42