MythTV
master
|
An action (for this plugin) consists of a description, and a set of key sequences. More...
#include <action.h>
Public Member Functions | |
Action (QString description) | |
Create a new empty action. More... | |
Action (QString description, const QString &keys) | |
bool | AddKey (const QString &key) |
Add a key sequence to this action. More... | |
bool | ReplaceKey (const QString &newkey, const QString &oldkey) |
Replace a key. More... | |
bool | RemoveKey (const QString &key) |
Remove a key from this action. More... | |
QString | GetDescription (void) const |
Returns the action description. (note: not threadsafe) More... | |
QStringList | GetKeys (void) const |
Returns the key sequence(s) that trigger this action. More... | |
QString | GetKeyString (void) const |
Returns comma delimited string of key bindings. More... | |
bool | IsEmpty (void) const |
Returns true iff the action has no keys. More... | |
bool | HasKey (const QString &key) const |
Determine if the action already has a key. More... | |
Static Public Attributes | |
static const unsigned int | kMaximumNumberOfBindings = 4 |
The maximum number of keys that can be bound to an action. More... | |
Private Attributes | |
QString | m_description |
The actions description. More... | |
QStringList | m_keys |
The keys bound to the action. More... | |
An action (for this plugin) consists of a description, and a set of key sequences.
On its own, the action cannot actually identify a particular action. This is a class to make the keybinding class easier to manage.
|
inlineexplicit |
Action::Action | ( | QString | description, |
const QString & | keys | ||
) |
Definition at line 40 of file action.cpp.
bool Action::AddKey | ( | const QString & | key | ) |
Add a key sequence to this action.
We don't add empty keys nor duplicates, and cannot add more than kMaximumNumberOfBindings. If any of these restrictions are a problem we return false and do not add the binding.
key | The key to add to the action. |
Definition at line 68 of file action.cpp.
Referenced by ActionSet::Add().
bool Action::ReplaceKey | ( | const QString & | newkey, |
const QString & | oldkey | ||
) |
Replace a key.
newkey | The new key. |
oldkey | The old key, which is being replaced. |
Definition at line 85 of file action.cpp.
Referenced by ActionSet::Replace().
|
inline |
Remove a key from this action.
Definition at line 52 of file action.h.
Referenced by ActionSet::Remove().
|
inline |
|
inline |
|
inline |
|
inline |
bool Action::HasKey | ( | const QString & | key | ) | const |
Determine if the action already has a key.
key | The key to check for. |
Definition at line 52 of file action.cpp.
Referenced by AddKey(), and ReplaceKey().
|
static |
The maximum number of keys that can be bound to an action.
Definition at line 71 of file action.h.
Referenced by AddKey(), MythControls::AddKeyToAction(), MythControls::Create(), MythControls::GetCurrentButton(), and MythControls::RefreshKeyInformation().
|
private |
|
private |
The keys bound to the action.
Definition at line 75 of file action.h.
Referenced by AddKey(), GetKeys(), GetKeyString(), HasKey(), IsEmpty(), RemoveKey(), and ReplaceKey().