Sayonara Player
VisualPlugin.h
1 /* VisualPlugin.h */
2 
3 /* Copyright (C) 2011-2019 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 "VisualStyleTypes.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(VisualPlugin)
45 
46 private:
47  void set_button_sizes();
48  void set_buttons_visible(bool b);
49 
50 protected:
51  VisualColorStyleChooser* m_ecsc=nullptr;
52 
53  void init_buttons();
54  Engine::Handler* engine() const;
55 
56  virtual void showEvent(QShowEvent* e) override;
57  virtual void closeEvent(QCloseEvent* e) override;
58  virtual void resizeEvent(QResizeEvent* e) override;
59  virtual void mousePressEvent(QMouseEvent* e) override;
60  virtual void enterEvent(QEvent* e) override;
61  virtual void leaveEvent(QEvent* e) override;
62 
63  virtual QWidget* widget()=0;
64  virtual ColorStyle current_style() const=0;
65  virtual int current_style_index() const=0;
66  virtual bool has_small_buttons() const=0;
67 
68  void stop_fadeout_timer();
69 
70 private slots:
71  void style_changed();
72 
73 
74 protected slots:
75  virtual void config_clicked();
76  virtual void next_clicked();
77  virtual void prev_clicked();
78 
79  virtual void do_fadeout_step()=0;
80 
81  virtual void playstate_changed(PlayState play_state);
82  virtual void played();
83  virtual void paused();
84  virtual void stopped();
85 
86 
87 public slots:
88  virtual void update_style(int new_index)=0;
89  virtual void update();
90  virtual void init_ui() override;
91 
92 
93 public:
94  explicit VisualPlugin(QWidget* parent=nullptr);
95  virtual ~VisualPlugin();
96 
97  virtual bool is_title_shown() const override;
98 };
99 
100 #endif // ENGINEPLUGIN_H
101 
102 
virtual bool is_title_shown() const override
indicates if title bar is shown or not
Definition: PlayerPluginBase.h:39
PlayState
The PlayState enum.
Definition: PlayState.h:28
Definition: AbstractEngine.h:32
The EngineHandler class.
Definition: EngineHandler.h:43
Definition: VisualColorStyleChooser.h:32
Definition: VisualPlugin.h:41
Definition: VisualStyleTypes.h:34