1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Metadata of song for details view. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef MPSONGDATA_H |
|
19 #define MPSONGDATA_H |
|
20 |
|
21 #include <QObject> |
|
22 #include <QString> |
|
23 #include <QPixmap> |
|
24 |
|
25 //forward declartions |
|
26 class QIcon; |
|
27 |
|
28 //class declaration |
|
29 class MpSongData : public QObject |
|
30 { |
|
31 Q_OBJECT |
|
32 |
|
33 public: |
|
34 explicit MpSongData( QObject *parent=0 ); |
|
35 virtual ~MpSongData(); |
|
36 |
|
37 bool setTitle( const QString &title ); |
|
38 bool setAlbum( const QString &album ); |
|
39 bool setArtist( const QString &artist ); |
|
40 bool setComment( const QString &comment ); |
|
41 void setAlbumArtUri( const QString &albumArtUri ); |
|
42 bool setYear( int date ); |
|
43 bool setGenre( const QString &genre ); |
|
44 bool setComposer( const QString &compoer ); |
|
45 bool setAlbumTrack( const QString &albumtrack ); |
|
46 void setLink( const QString &link ); |
|
47 |
|
48 // inform details view when basic information is ready to accelerate UI update |
|
49 void commitPlaybackInfo(); |
|
50 // inform details view when details information is ready |
|
51 void commitSongDetailInfo(); |
|
52 |
|
53 public slots: |
|
54 void thumbnailReady( const QPixmap& pixmap, void *data, int id, int error ); |
|
55 |
|
56 int reservedLength() const { return mLink.length() + mTitle.length() + mArtist.length(); } |
|
57 |
|
58 QString title() const; |
|
59 QString album() const; |
|
60 QString artist() const; |
|
61 QString comment() const; |
|
62 void albumArt( QPixmap& pixmap ); |
|
63 QString year() const; |
|
64 QString genre() const; |
|
65 QString composer() const; |
|
66 QString albumTrack() const; |
|
67 QString link() const; |
|
68 |
|
69 signals: |
|
70 void albumArtReady(); |
|
71 void playbackInfoChanged(); |
|
72 void songDetailInfoChanged(); |
|
73 |
|
74 private: |
|
75 QString mTitle; |
|
76 QString mAlbum; |
|
77 QString mArtist; |
|
78 QString mComment; |
|
79 QString mComposer; |
|
80 QString mGenre; |
|
81 QString mYear; |
|
82 QString mAlbumTrack; |
|
83 QPixmap mAlbumArt; |
|
84 TInt mReqId; |
|
85 QString currentAAUri; |
|
86 QPixmap mDefaultAlbumArt; |
|
87 QString mLink; |
|
88 |
|
89 Q_DISABLE_COPY(MpSongData) |
|
90 }; |
|
91 |
|
92 #endif // MPSONGDATA_H |
|