Sayonara Player
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Gui
Plugins
PlayerPluginBase.h
1
/* PlayerPlugin.h */
2
3
/* Copyright (C) 2011-2024 Michael Lugmair (Lucio Carreras)
4
*
5
* This file is part of sayonara player
6
*
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
*/
20
21
#ifndef PLAYERPLUGIN_H
22
#define PLAYERPLUGIN_H
23
24
#include "Gui/Utils/Widgets/Widget.h"
25
#include "Utils/Pimpl.h"
26
27
class
QAction;
28
34
35
namespace
PlayerPlugin
36
{
37
class
Handler
;
38
class
Base :
39
public
Gui::Widget
40
{
41
friend
class
Handler;
42
43
Q_OBJECT
44
45
private
:
46
PIMPL(Base)
47
48
public
:
49
explicit
Base(QWidget* parent =
nullptr
);
50
virtual
~Base()
override
;
51
52
signals:
59
void
sigActionTriggered
(
bool
checked);
60
65
void
sigReload
(
PlayerPlugin::Base
* plugin);
66
67
void
sigOpened();
68
69
private
slots:
75
void
actionTriggered(
bool
checked);
76
77
private
:
78
82
void
setUiInitialized();
83
87
virtual
void
languageChanged() final override;
88
92
virtual
void
initUi() = 0;
93
94
protected:
95
virtual
void
finalizeInitialization();
96
101
virtual
bool
isUiInitialized
() const;
102
virtual
void
assignUiVariables();
103
104
virtual
void
retranslate() = 0;
105
106
template<typename T, typename UiClass>
107
void
setupParent(T* widget, UiClass** ui)
108
{
109
if
(
isUiInitialized
())
110
{
111
return
;
112
}
113
114
*ui =
new
UiClass();
115
(*ui)->setupUi(widget);
116
117
assignUiVariables();
118
finalizeInitialization();
119
}
120
121
void
closeEvent(QCloseEvent* e)
override
;
122
void
showEvent(QShowEvent* e)
override
;
123
124
public
:
125
130
virtual
QAction*
pluginAction
() const final;
131
136
virtual QString
name
() const = 0;
137
142
virtual QString
displayName
() const = 0;
143
147
virtual
bool
hasTitle
() const;
148
154
virtual
bool
hasLoadingBar
() const;
155
};
156
}
157
158
Q_DECLARE_INTERFACE(
PlayerPlugin
::Base,
"com.sayonara-player.playerplugin"
)
159
160
#endif
// PLAYERPLUGIN_H
Gui::Widget
Widget with Settings connection. Also contains triggers for language_changed() and skin_changed() \nT...
Definition
Widget.h:39
PlayerPlugin::Base
Definition
PlayerPluginBase.h:40
PlayerPlugin::Base::hasTitle
virtual bool hasTitle() const
indicates if title bar is shown or not
PlayerPlugin::Base::sigActionTriggered
void sigActionTriggered(bool checked)
signal is emitted when the plugin action is triggered also emitted for when closeEvent is fired
PlayerPlugin::Base::pluginAction
virtual QAction * pluginAction() const final
needed by the player ui, final
PlayerPlugin::Base::hasLoadingBar
virtual bool hasLoadingBar() const
indicates if the widget has a loading bar. If yes, there will be reserved some extra space at the bot...
PlayerPlugin::Base::isUiInitialized
virtual bool isUiInitialized() const
Check if ui already was initialized.
PlayerPlugin::Base::displayName
virtual QString displayName() const =0
must be overwritten
PlayerPlugin::Base::name
virtual QString name() const =0
must be overwritten
PlayerPlugin::Base::sigReload
void sigReload(PlayerPlugin::Base *plugin)
emitted when reloading is requested, after firing this signal the plugin will be painted new....
PlayerPlugin::Handler
Definition
PlayerPluginHandler.h:35
PlayerPlugin
Interface for PlayerPlugin classes. get_name() and language_changed() must be overwritten.
Definition
GUI_Player.h:47
Generated on
for Sayonara Player by
1.17.0