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" 36 #include "Components/PlayManager/PlayManager.h" 83 void action_triggered(
bool checked);
85 void _sl_lang_changed();
91 void set_size(QSize size);
140 void change_exit_icon(QPushButton* close_button);
145 void setup_parent(T* widget){
147 QLayout* widget_layout;
149 QPushButton* btn_close;
151 widget->setupUi(widget);
156 lab_title->setText(widget->get_display_name());
157 lab_title->setMaximumHeight(24);
158 lab_title->setMinimumHeight(24);
161 widget_layout = layout();
163 widget_layout->setContentsMargins(3, 3, 3, 0);
168 btn_close->resize(24, 24);
174 sc = sch->
add(
Shortcut(
this,
"close_plugin", tr(
"Close plugin"),
"Ctrl+Esc"));
179 REGISTER_LISTENER(Set::Player_Language, _sl_lang_changed);
180 REGISTER_LISTENER(Set::Player_Style, skin_changed);
185 virtual void skin_changed();
214 virtual QSize
get_size() const final;
269 #endif // PLAYERPLUGIN_H 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:79
virtual QLabel * get_title_label() const =0
must be overwritten
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:67
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:104
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:48
PlayManager * _play_manager
_play_manager Notifies about playstate
Definition: PlayerPlugin.h:99
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 language_changed()=0
language_changed Has to be implemented and is called when language has changed
virtual void stopped()
Playstate has changed to stop.
virtual QPushButton * get_close_button() const =0
must be overwritten
Definition: PlayerPluginHandler.h:34
virtual void played()
Playstate has changed to playing.
virtual QString get_display_name() const =0
must be overwritten