Add an implementation of the CustomActionsCapability interface that spans all service...
[amarok.git] / src / systray.h
blobdbbb4212f16b37aa6fab2153284faf57740c1ca0
1 //
2 // AmarokSystray
3 //
4 // Author: Stanislav Karchebny <berkus@users.sf.net>, (C) 2003
5 //
6 // Copyright: like rest of Amarok
7 //
9 #ifndef AMAROKSYSTRAY_H
10 #define AMAROKSYSTRAY_H
12 #include "engineobserver.h" //baseclass
14 #include <ksystemtrayicon.h>
16 #include <QPixmap>
18 class QEvent;
20 class App;
22 namespace Amarok {
24 class TrayIcon : public KSystemTrayIcon, public EngineObserver
26 public:
27 TrayIcon( QWidget* );
28 friend class ::App;
30 protected:
31 // reimpl from engineobserver
32 virtual void engineStateChanged( Engine::State state, Engine::State oldState = Engine::Empty );
33 virtual void engineNewMetaData( const QHash<qint64, QString> &newMetaData, bool trackChanged );
34 virtual void engineTrackPositionChanged( long position, bool /*userSeek*/ );
35 // get notified of 'highlight' color change
36 virtual void paletteChange( const QPalette & oldPalette );
38 private:
39 bool event( QEvent* );
40 void setLastFm( bool );
42 // repaints trayIcon showing progress (and overlay if present)
43 void paintIcon( int mergePixels = -1, bool force = false );
44 // blend an overlay icon over 'sourcePixmap' and repaint trayIcon
45 void blendOverlay( QPixmap &sourcePixmap );
47 long trackLength, mergeLevel;
48 QIcon baseIcon;
49 QPixmap grayedIcon, alternateIcon;
50 QPixmap playOverlay, pauseOverlay;
51 QPixmap *overlay; // the current overlay (may be NULL)
52 int blinkTimerID; // timer ID returned by QObject::startTimer()
53 bool overlayVisible;// used for blinking / hiding overlay
54 /** whether the last.fm icons are visible **/
55 bool m_lastFmMode;
60 #endif