23 #ifndef PLAYERPLUGIN_H 24 #define PLAYERPLUGIN_H 27 #include <QCloseEvent> 29 #include <QPushButton> 32 #include "GUI/Helper/SayonaraWidget/SayonaraWidget.h" 33 #include "GUI/Helper/Shortcuts/ShortcutWidget.h" 34 #include "GUI/Helper/Shortcuts/ShortcutHandler.h" 35 #include "GUI/Helper/IconLoader/IconLoader.h" 37 #include "Components/PlayManager/PlayManager.h" 84 void action_triggered(
bool checked);
86 void _sl_lang_changed();
92 void set_size(QSize size);
142 void setup_parent(T* widget){
148 QLayout* widget_layout;
150 widget->setupUi(widget);
153 widget_layout = layout();
155 widget_layout->setContentsMargins(3, 3, 3, 3);
161 sc = sch->
add(
Shortcut(
this,
"close_plugin", tr(
"Close plugin"),
"Ctrl+Esc"));
166 REGISTER_LISTENER(Set::Player_Language, _sl_lang_changed);
167 REGISTER_LISTENER(Set::Player_Style, skin_changed);
200 virtual QSize
get_size() const final;
233 virtual
bool is_title_shown() const;
246 #endif // PLAYERPLUGIN_H virtual void language_changed() override=0
language_changed Has to be implemented and is called when language has changed
virtual QString get_name() const =0
must be overwritten
virtual void playstate_changed(PlayManager::PlayState state)
Playstate has changed, this does nothing in default implementation.
A singleton class for retrieving shortcuts.
Definition: ShortcutHandler.h:41
PlayState
Current Playing state.
Definition: PlayManager.h:91
virtual void init_ui()=0
GUI will be initialized on first show up. Please use this to make Sayonara starting fast...
bool is_valid() const
Check if the shortcut is valid or if it was retrieved via getInvalid()
virtual void paused()
Playstate has changed to paused.
A single shortcut managed by ShortcutHandler. This class holds information about the default shortcut...
Definition: Shortcut.h:42
virtual QAction * get_action() const final
needed by the player ui, final
virtual void show()
show Plugin
Global handler for current playback state (Singleton)
Definition: PlayManager.h:79
void set_ui_initialized()
mark ui as initialized
void sig_action_triggered(PlayerPluginInterface *plugin, bool checked)
signal is emitted when the plugin action is triggered also emitted for when closeEvent is fired ...
virtual QSize get_size() const final
needed by the player ui, final
QAction * _pp_action
_pp_action already allocated, displays name of the plugin by calling get_name()
Definition: PlayerPlugin.h:105
void create_qt_shortcut(QWidget *parent, T func)
create a qt shortcut for a widget
Definition: Shortcut.h:142
virtual bool is_closed() const final
needed by the player ui, final
QString get_shortcut_text(const QString &shortcut_identifier) const override
get translated text of shortcut (overridden)
Interface for PlayerPlugin classes. get_name() and language_changed() must be overwritten.
Definition: PlayerPlugin.h:49
PlayManager * _play_manager
_play_manager Notifies about playstate
Definition: PlayerPlugin.h:100
Shortcut add(const Shortcut &shortcut)
add a new shortcut instance to the handler. This is usually done by the widget the shortcut is attach...
bool is_ui_initialized() const
Check if ui already was initialized.
void sig_reload(PlayerPluginInterface *)
emitted when reloading is requested, after firing this signal the plugin will be painted new...
Shortcut get_shortcut(const QString &identifier) const
get a shortcut by its unique identifier
void closeEvent(QCloseEvent *e) override
Event fired when closed overrides QWidget::closeEvent.
virtual void stopped()
Playstate has changed to stop.
Definition: PlayerPluginHandler.h:34
virtual void played()
Playstate has changed to playing.
virtual QString get_display_name() const =0
must be overwritten