Child: [03d400] (diff)

Download this file

trayicon.h    124 lines (100 with data), 3.3 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/* GUI_TrayIcon.h */
/* Copyright (C) 2012 gleugner
*
* This file is part of sayonara player
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GUI_TRAYICON_H
#define GUI_TRAYICON_H
#include "HelperStructs/CSettingsStorage.h"
#include "HelperStructs/MetaData.h"
//#include "Notification/Notification.h"
//#include "Notification/NotificationPluginLoader.h"
class NotificationPluginLoader;
#include <QSystemTrayIcon>
#include <QAction>
#include <QTimer>
/**
* Small class to be used as tray icon
*/
class GUI_TrayIcon : public QSystemTrayIcon {
Q_OBJECT
public:
GUI_TrayIcon(QObject *parent = 0);
virtual ~GUI_TrayIcon();
virtual bool event(QEvent * e);
void set_timeout(int timeout_ms);
void set_notification_active(bool active);
void set_enable_play(bool);
void set_enable_stop(bool);
void set_enable_mute(bool);
void set_enable_fwd(bool);
void set_enable_bwd(bool);
void set_enable_show(bool);
int get_vol_step();
public slots:
void trackChanged(const MetaData& md);
void songChangedMessage(const MetaData& md);
void setPlaying(bool);
void setMute(bool mute);
void change_skin(QString stylesheet);
void stop();
signals:
/**
* this event is fired, if we have a mouse wheel event
* @param delta bigger then 0 when mouse wheel has moved forward
smaller when moved backwards
*/
void sig_volume_changed_by_wheel(int delta);
void sig_play_clicked();
void sig_pause_clicked();
void sig_fwd_clicked();
void sig_bwd_clicked();
void sig_show_clicked();
void sig_hide_clicked();
void sig_close_clicked();
void sig_mute_clicked();
void sig_stop_clicked();
private slots:
void play_clicked();
void stop_clicked();
void fwd_clicked();
void bwd_clicked();
void show_clicked();
void close_clicked();
void mute_clicked();
void timer_timed_out();
private:
QAction* m_closeAction;
QAction* m_playAction;
QAction* m_stopAction;
QAction* m_muteAction;
QAction* m_fwdAction;
QAction* m_bwdAction;
QAction* m_showAction;
QMenu* m_trayContextMenu;
QIcon m_playIcon;
QIcon m_pauseIcon;
int m_timeout;
int m_vol_step;
NotificationPluginLoader* m_plugin_loader;
bool m_notification_active;
bool m_playing;
bool m_mute;
CSettingsStorage* m_settings;
bool _md_set;
MetaData _md;
QTimer* _timer;
bool _mute;
};
#endif