1 #ifndef CSM_PREFS_SHORTCUTMANAGER_H
2 #define CSM_PREFS_SHORTCUTMANAGER_H
6 #include <QKeySequence>
13 class ShortcutEventHandler;
30 bool getSequence(
const std::string&
name, QKeySequence& sequence)
const;
31 void setSequence(
const std::string& name,
const QKeySequence& sequence);
33 bool getModifier(
const std::string& name,
int& modifier)
const;
34 void setModifier(
const std::string& name,
int modifier);
39 std::string
convertToString(
const QKeySequence& sequence,
int modifier)
const;
44 void convertFromString(
const std::string& data, QKeySequence& sequence,
int& modifier)
const;
55 typedef std::map<int, std::string>
NameMap;
56 typedef std::map<std::string, int>
KeyMap;
69 static const std::pair<int, const char*>
QtKeys[];
void setSequence(const std::string &name, const QKeySequence &sequence)
Definition: shortcutmanager.cpp:58
std::string convertToString(const QKeySequence &sequence) const
Definition: shortcutmanager.cpp:115
SequenceMap mSequences
Definition: shortcutmanager.hpp:59
void convertFromString(const std::string &data, QKeySequence &sequence) const
Definition: shortcutmanager.cpp:177
void createLookupTables()
Definition: shortcutmanager.cpp:267
Users of this class should install it as an event handler.
Definition: shortcuteventhandler.hpp:17
std::map< std::string, int > KeyMap
Definition: shortcutmanager.hpp:56
QString processToolTip(const QString &toolTip) const
Replaces "{sequence-name}" or "{modifier-name}" with the appropriate text.
Definition: shortcutmanager.cpp:289
void setModifier(const std::string &name, int modifier)
Definition: shortcutmanager.cpp:93
void addShortcut(Shortcut *shortcut)
The shortcut class will do this automatically.
Definition: shortcutmanager.cpp:19
NameMap mNames
Definition: shortcutmanager.hpp:62
bool getSequence(const std::string &name, QKeySequence &sequence) const
Definition: shortcutmanager.cpp:45
KeyMap mKeys
Definition: shortcutmanager.hpp:63
std::map< std::string, int > ModifierMap
Definition: shortcutmanager.hpp:54
static const std::pair< int, const char * > QtKeys[]
Definition: shortcutmanager.hpp:69
std::multimap< std::string, Shortcut * > ShortcutMap
Definition: shortcutmanager.hpp:52
std::map< int, std::string > NameMap
Definition: shortcutmanager.hpp:55
ShortcutEventHandler * mEventHandler
Definition: shortcutmanager.hpp:65
Class used to track and update shortcuts/sequences.
Definition: shortcutmanager.hpp:16
ShortcutMap mShortcuts
Definition: shortcutmanager.hpp:58
ShortcutManager()
Definition: shortcutmanager.cpp:13
std::map< std::string, QKeySequence > SequenceMap
Definition: shortcutmanager.hpp:53
void removeShortcut(Shortcut *shortcut)
The shortcut class will do this automatically.
Definition: shortcutmanager.cpp:26
A class similar in purpose to QShortcut, but with the ability to use mouse buttons.
Definition: shortcut.hpp:16
bool getModifier(const std::string &name, int &modifier) const
Definition: shortcutmanager.cpp:80
ModifierMap mModifiers
Definition: shortcutmanager.hpp:60
const char * name
Definition: crashcatcher.cpp:59