Sayonara Player
EnginePlugin.h
1 /* EnginePlugin.h */
2 
3 /* Copyright (C) 2011-2016 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 
22 
23 #ifndef ENGINEPLUGIN_H
24 #define ENGINEPLUGIN_H
25 
26 #include "GUI_StyleSettings.h"
27 
28 #include "Interfaces/PlayerPlugin/PlayerPlugin.h"
29 
30 #include "EngineColorStyleChooser.h"
31 
32 #include <QAction>
33 #include <QColor>
34 #include <QTimer>
35 #include <QPushButton>
36 #include <QMouseEvent>
37 #include <QResizeEvent>
38 #include <QPaintEvent>
39 #include <QShowEvent>
40 
41 class EngineHandler;
43 
44  Q_OBJECT
45 
46 protected:
47 
48  QPushButton* _btn_config=nullptr;
49  QPushButton* _btn_prev=nullptr;
50  QPushButton* _btn_next=nullptr;
51  QPushButton* _btn_close=nullptr;
52 
53  EngineHandler* _engine=nullptr;
54  GUI_StyleSettings* _ui_style_settings=nullptr;
55  EngineColorStyleChooser* _ecsc=nullptr;
56  ColorStyle _cur_style;
57  int _cur_style_idx;
58 
59  QTimer* _timer=nullptr;
60  int _timer_stopped;
61 
62  void init_buttons(bool small);
63 
64  //virtual void showEvent(QShowEvent* e) override;
65  virtual void closeEvent(QCloseEvent* e) override;
66  virtual void resizeEvent(QResizeEvent* e) override;
67  virtual void mousePressEvent(QMouseEvent* e) override;
68  virtual void enterEvent(QEvent* e) override;
69  virtual void leaveEvent(QEvent* e) override;
70  virtual QLabel* get_title_label() const override;
71  virtual QPushButton* get_close_button() const override;
72 
73 
74 
75 protected slots:
76 
77  virtual void config_clicked();
78  virtual void next_clicked();
79  virtual void prev_clicked();
80 
81  virtual void timed_out()=0;
82 
83  virtual void played();
84  virtual void paused();
85  virtual void stopped();
86 
87 
88 public slots:
89  virtual void sl_update_style()=0;
90  virtual void update();
91  virtual void init_ui() override;
92 
93 
94 public:
95  EnginePlugin(QWidget* parent=nullptr);
96  virtual ~EnginePlugin();
97 
98 };
99 
100 #endif // ENGINEPLUGIN_H
101 
102 
virtual QPushButton * get_close_button() const override
must be overwritten
virtual QLabel * get_title_label() const override
must be overwritten
Definition: EngineColorStyleChooser.h:34
Definition: EngineHandler.h:36
Definition: StyleTypes.h:36
Definition: GUI_StyleSettings.h:36
Definition: EnginePlugin.h:42
Interface for PlayerPlugin classes. get_name() and language_changed() must be overwritten.
Definition: PlayerPlugin.h:48