Sayonara Player
GUI_TrayIcon.h
1 /* GUI_TrayIcon.h */
2 
3 /* Copyright (C) 2011-2017 Lucio Carreras gleugner
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 GUI_TRAYICON_H
22 #define GUI_TRAYICON_H
23 
24 
25 
26 #include "Interfaces/Notification/NotificationHandler.h"
27 #include "Components/PlayManager/PlayState.h"
28 
29 #include "Utils/Settings/SayonaraClass.h"
30 #include "Utils/Pimpl.h"
31 
32 #include <QSystemTrayIcon>
33 
34 
35 class QTimer;
36 class QAction;
37 class MetaData;
41 class GUI_TrayIcon :
42  public QSystemTrayIcon,
43  public NotificationInterface,
44  public SayonaraClass
45 {
46  Q_OBJECT
47  PIMPL(GUI_TrayIcon)
48 
49 public:
50 
51  explicit GUI_TrayIcon(QObject *parent=nullptr);
52  virtual ~GUI_TrayIcon();
53 
54  bool event ( QEvent * e ) override;
55  void set_enable_fwd(bool);
56 
57  void notify(const MetaData& md) override;
58  void notify(const QString &title, const QString &message, const QString &image_path) override;
59 
60  QString name() const override;
61  QString display_name() const override;
62 
63 signals:
64 
69  void sig_wheel_changed(int delta);
70  void sig_hide_clicked();
71  void sig_close_clicked();
72  void sig_show_clicked();
73 
74 
75 private slots:
76  void play_clicked();
77  void stop_clicked();
78  void fwd_clicked();
79  void bwd_clicked();
80  void show_clicked();
81  void close_clicked();
82  void mute_clicked();
83  void cur_song_clicked();
84 
85  void playstate_changed(PlayState state);
86 
87  void mute_changed(bool muted);
88  void _sl_show_tray_icon();
89 
90  void language_changed();
91  void skin_changed();
92 
93 private:
94  void init_context_menu();
95 };
96 
97 #endif
Definition: NotificationInterface.h:30
void notify(const MetaData &md) override
notify when Metadata has been changed
Definition: GUI_TrayIcon.h:41
The SayonaraClass class provides access to Settings and notifications.
Definition: SayonaraClass.h:29
PlayState
The PlayState enum.
Definition: PlayState.h:28
The MetaData class.
Definition: MetaData.h:48
QString name() const override
get name of notification interface
void sig_wheel_changed(int delta)