add mp3 and ogg torrent url info to JamendoAlbum
[amarok.git] / src / tracktooltip.h
blobdaddd62f28fcb8456cd5aa0044cfa88cf85c6c5e
1 /*
2 This program is free software; you can redistribute it and/or modify
3 it under the terms of the GNU General Public License as published by
4 the Free Software Foundation; either version 2 of the License, or
5 (at your option) any later version.
6 */
8 /*
9 tracktooltip.h - Provides an interface to a plain QWidget, which is independent of KDE (bypassed to X11)
10 begin: Tue 10 Feb 2004
11 copyright: (C) 2004 by Christian Muehlhaeuser
12 email: chris@chris.de
15 #ifndef TRACKTOOLTIP_H
16 #define TRACKTOOLTIP_H
18 #include "metabundle.h"
19 #include "tooltip.h"
21 #include <QObject>
22 #include <q3ptrlist.h>
24 class QWidget;
26 class TrackToolTip: public QObject, public Amarok::ToolTipClient
28 Q_OBJECT
30 public:
31 TrackToolTip();
32 static TrackToolTip* instance();
34 void addToWidget( QWidget *widget );
35 void removeFromWidget( QWidget *widget );
37 void setTrack( const MetaBundle &tags, bool force = false );
38 void setPos( int pos );
39 void clear();
41 public:
42 virtual QPair<QString, QRect> toolTipText( QWidget*, const QPoint& ) const;
44 private slots:
45 void slotCoverChanged( const QString &artist, const QString &album );
46 void slotImageChanged( const QString &remoteURL );
47 void slotUpdate( const QString &url = QString() );
48 void slotMoodbarEvent( void );
50 private:
51 QString tooltip() const;
52 void updateWidgets();
54 static TrackToolTip *s_instance;
55 Q3PtrList<QWidget> m_widgets;
56 MetaBundle m_tags;
57 int m_pos;
58 QString m_cover;
59 QString m_tooltip;
60 bool m_haspos;
61 QString m_moodbarURL;
64 #endif