4 // Author: Stanislav Karchebny <berkus@users.sf.net>, (C) 2003
6 // Copyright: like rest of Amarok
9 #ifndef AMAROKSYSTRAY_H
10 #define AMAROKSYSTRAY_H
12 #include "engineobserver.h" //baseclass
14 #include <ksystemtrayicon.h>
24 class TrayIcon
: public KSystemTrayIcon
, public EngineObserver
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
);
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
;
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 **/