Sayonara Player
Public Member Functions | Protected Attributes | List of all members
ShortcutHandler Class Reference

#include <ShortcutHandler.h>

Detailed Description

A singleton class for retrieving shortcuts.

Public Member Functions

Shortcut get_shortcut (const QString &identifier) const
 get a shortcut by its unique identifier More...
 
void set_shortcut (const QString &identifier, const QStringList &shortcut)
 set the shortcut by its unique identifier More...
 
void set_shortcut (const Shortcut &shortcut)
 Overwrite a shortcut. More...
 
Shortcut add (const Shortcut &shortcut)
 add a new shortcut instance to the handler. This is usually done by the widget the shortcut is attached to. So you can use the same shortcut on multiple widgets More...
 
QList< Shortcutget_shortcuts () const
 get all shortcuts More...
 

Protected Attributes

Settings_settings =nullptr
 

Member Function Documentation

◆ add()

Shortcut ShortcutHandler::add ( const Shortcut shortcut)

add a new shortcut instance to the handler. This is usually done by the widget the shortcut is attached to. So you can use the same shortcut on multiple widgets

Parameters
shortcuta shortcut instance
Returns
an invalid shortcut, if source shortcut is invalid, too
if the shortcut already exists, the instance already known is returned
if the shortcut does not exist yet, the same shortcut as the input is returned

◆ get_shortcut()

Shortcut ShortcutHandler::get_shortcut ( const QString &  identifier) const

get a shortcut by its unique identifier

Parameters
identifierthe identifier which is used in database
Returns
a shortcut instance

◆ get_shortcuts()

QList<Shortcut> ShortcutHandler::get_shortcuts ( ) const

get all shortcuts

Returns

◆ set_shortcut() [1/2]

void ShortcutHandler::set_shortcut ( const QString &  identifier,
const QStringList &  shortcut 
)

set the shortcut by its unique identifier

Parameters
identifierthe identifier which is used in database
shortcuta shortcut instance

◆ set_shortcut() [2/2]

void ShortcutHandler::set_shortcut ( const Shortcut shortcut)

Overwrite a shortcut.

Parameters
shortcuta shortcut instance
Inheritance diagram for ShortcutHandler:
SayonaraClass