Chatterino
Hotkey.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include <QKeySequence>
6 #include <QString>
7 
8 #include <vector>
9 
10 namespace chatterino {
11 
12 class Hotkey
13 {
14 public:
15  Hotkey(HotkeyCategory category, QKeySequence keySequence, QString action,
16  std::vector<QString> arguments, QString name);
17  virtual ~Hotkey() = default;
18 
25  QString toString() const;
26 
33  QString toPortableString() const;
34 
40  HotkeyCategory category() const;
41 
47  QString action() const;
48 
49  bool validAction() const;
50 
56  std::vector<QString> arguments() const;
57 
63  QString name() const;
64 
71  QString getCategory() const;
72 
78  const QKeySequence &keySequence() const;
79 
80 private:
81  HotkeyCategory category_;
82  QKeySequence keySequence_;
83  QString action_;
84  std::vector<QString> arguments_;
85  QString name_;
86 
92  Qt::ShortcutContext getContext() const;
93 
94  friend class HotkeyController;
95 };
96 
97 } // namespace chatterino
const QKeySequence & keySequence() const
Returns the programmating key sequence of the hotkey.
Definition: Hotkey.cpp:20
QString toPortableString() const
Returns the portable string representation of the hotkey.
Definition: Hotkey.cpp:88
QString name() const
Returns the display name of the hotkey.
Definition: Hotkey.cpp:25
Hotkey(HotkeyCategory category, QKeySequence keySequence, QString action, std::vector< QString > arguments, QString name)
Definition: Hotkey.cpp:10
Definition: Application.cpp:48
HotkeyCategory category() const
Returns the category where this hotkey is active. This is labeled the "Category" in the UI...
Definition: Hotkey.cpp:30
QString toString() const
Returns the OS-specific string representation of the hotkey.
Definition: Hotkey.cpp:83
virtual ~Hotkey()=default
Definition: Hotkey.hpp:12
QString action() const
Returns the action which describes what this Hotkey is meant to do.
Definition: Hotkey.cpp:35
QString getCategory() const
Returns the user-friendly text representation of the hotkeys category.
Definition: Hotkey.cpp:59
Definition: HotkeyController.hpp:22
std::vector< QString > arguments() const
Returns a list of arguments this hotkey has bound to it.
Definition: Hotkey.cpp:54
bool validAction() const
Definition: Hotkey.cpp:40
HotkeyCategory
Definition: HotkeyCategory.hpp:10