Sayonara Player
EnginePlugin.h
1 /* EnginePlugin.h */
2 
3 /* Copyright (C) 2011-2017 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 ENGINEPLUGIN_H
22 #define ENGINEPLUGIN_H
23 
24 #include "GUI_StyleSettings.h"
25 #include "GUI/Plugins/Engine/StyleTypes.h"
26 #include "Interfaces/PlayerPlugin/PlayerPluginBase.h"
27 #include "Components/PlayManager/PlayState.h"
28 
29 #include "Utils/Pimpl.h"
30 
31 #include <QTimer>
32 #include <QPushButton>
33 
35 
36 namespace Engine
37 {
38  class Handler;
39 }
40 
42 {
43  Q_OBJECT
44  PIMPL(EnginePlugin)
45 
46 protected:
47  GUI_StyleSettings* _ui_style_settings=nullptr;
48  EngineColorStyleChooser* _ecsc=nullptr;
49  ColorStyle _cur_style;
50  int _cur_style_idx;
51 
52  void init_buttons(bool small);
53  Engine::Handler* engine() const;
54 
55  virtual void closeEvent(QCloseEvent* e) override;
56  virtual void resizeEvent(QResizeEvent* e) override;
57  virtual void mousePressEvent(QMouseEvent* e) override;
58  virtual void enterEvent(QEvent* e) override;
59  virtual void leaveEvent(QEvent* e) override;
60 
61  virtual QWidget* widget()=0;
62  virtual bool has_small_buttons() const=0;
63 
64  void stop_fadeout_timer();
65 
66 
67 protected slots:
68  virtual void config_clicked();
69  virtual void next_clicked();
70  virtual void prev_clicked();
71 
72  virtual void do_fadeout_step()=0;
73 
74  virtual void playstate_changed(PlayState play_state);
75  virtual void played();
76  virtual void paused();
77  virtual void stopped();
78 
79 
80 public slots:
81  virtual void sl_update_style()=0;
82  virtual void update();
83  virtual void init_ui() override;
84 
85 
86 public:
87  explicit EnginePlugin(QWidget* parent=nullptr);
88  virtual ~EnginePlugin();
89 
90  virtual bool is_title_shown() const override;
91 };
92 
93 #endif // ENGINEPLUGIN_H
94 
95 
Definition: PlayerPluginBase.h:40
PlayState
The PlayState enum.
Definition: PlayState.h:28
Definition: AbstractEngine.h:33
The EngineHandler class.
Definition: EngineHandler.h:43
virtual bool is_title_shown() const override
indicates if title bar is shown or not
Definition: EngineColorStyleChooser.h:32
Definition: StyleTypes.h:34
Definition: GUI_StyleSettings.h:31
Definition: EnginePlugin.h:41