2010-01-08 15:52:05 +01:00
|
|
|
#ifndef OSD_H
|
|
|
|
#define OSD_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QSystemTrayIcon>
|
|
|
|
|
|
|
|
#include "engine_fwd.h"
|
|
|
|
#include "song.h"
|
|
|
|
|
2010-01-08 16:16:59 +01:00
|
|
|
#ifdef Q_WS_X11
|
|
|
|
# ifndef _NOTIFY_NOTIFICATION_H_
|
|
|
|
struct NotifyNotification;
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
2010-01-08 15:52:05 +01:00
|
|
|
class OSD : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
OSD(QSystemTrayIcon* tray_icon, QObject* parent = 0);
|
|
|
|
|
2010-02-03 18:21:25 +01:00
|
|
|
static const char* kSettingsGroup;
|
|
|
|
|
|
|
|
enum Behaviour {
|
|
|
|
Disabled = 0,
|
|
|
|
Native,
|
|
|
|
TrayPopup,
|
|
|
|
};
|
2010-01-08 15:52:05 +01:00
|
|
|
|
|
|
|
public slots:
|
2010-02-03 18:21:25 +01:00
|
|
|
void ReloadSettings();
|
|
|
|
|
2010-01-08 15:52:05 +01:00
|
|
|
void SongChanged(const Song& song);
|
|
|
|
void Paused();
|
|
|
|
void Stopped();
|
2010-01-08 17:40:34 +01:00
|
|
|
void VolumeChanged(int value);
|
2010-01-08 15:52:05 +01:00
|
|
|
|
2010-02-03 18:21:25 +01:00
|
|
|
private:
|
|
|
|
void ShowMessage(const QString& summary,
|
|
|
|
const QString& message = QString::null,
|
|
|
|
const QString& icon = QString::null);
|
|
|
|
|
|
|
|
// These are implemented in the OS-specific files
|
|
|
|
void Init();
|
|
|
|
bool CanShowNativeMessages() const;
|
|
|
|
void ShowMessageNative(const QString& summary,
|
|
|
|
const QString& message = QString::null,
|
|
|
|
const QString& icon = QString::null);
|
|
|
|
|
2010-01-08 15:52:05 +01:00
|
|
|
private:
|
|
|
|
QSystemTrayIcon* tray_icon_;
|
2010-01-08 16:37:35 +01:00
|
|
|
int timeout_;
|
2010-02-03 18:21:25 +01:00
|
|
|
Behaviour behaviour_;
|
2010-01-08 16:16:59 +01:00
|
|
|
|
|
|
|
#ifdef Q_WS_X11
|
|
|
|
NotifyNotification* notification_;
|
|
|
|
#endif
|
2010-01-08 15:52:05 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // OSD_H
|