44 MpQueryManager(); |
45 MpQueryManager(); |
45 ~MpQueryManager(); |
46 ~MpQueryManager(); |
46 |
47 |
47 public: |
48 public: |
48 void reset(); |
49 void reset(); |
49 void queryLocalMusicStore( QString mArtist,QString mAlbum,QString mTitle ); |
|
50 void queryInspireMeItems( QString mArtist,QString mAlbum,QString mTitle ); |
50 void queryInspireMeItems( QString mArtist,QString mAlbum,QString mTitle ); |
51 void queryLocalMusicStore(); |
51 void queryLocalMusicStore(); |
52 bool isLocalMusicStore() const; |
52 bool isLocalMusicStore(); |
53 |
53 |
54 int recommendationsCount() const; |
54 int recommendationsCount() const; |
55 QString recommendedSong(int index) const; |
55 QString recommendedSong(int index) const; |
56 QString recommendedArtist(int index) const; |
56 QString recommendedArtist(int index) const; |
57 HbIcon recommendedAlbumArt(int index) const; |
57 HbIcon recommendedAlbumArt(int index) const; |
58 |
58 |
59 private slots: |
59 private slots: |
60 void retrieveInformationFinished( QNetworkReply* reply ); |
60 void retrieveInformationFinished( QNetworkReply* reply ); |
61 void retrieveInformationNetworkError( QNetworkReply::NetworkError error ); |
61 void retrieveInformationNetworkError( QNetworkReply::NetworkError error ); |
62 void retrieveInformationSslErrors( const QList<QSslError> &error ); |
62 void retrieveInformationSslErrors( const QList<QSslError> &error ); |
63 void albumArtDownloaded( QNetworkReply* reply ); |
63 void albumArtDownloaded( int index ); |
64 void setAlbumArtUri( const QString &albumArtUri, const QString &albumArtName ); |
|
65 void thumbnailReady( const QPixmap pixmap, void *data, int id, int error ); |
|
66 |
64 |
67 private: |
65 private: |
68 void clearThumbnails(); |
|
69 void clearRecommendations(); |
66 void clearRecommendations(); |
70 void clearNetworkReplies(); |
67 void clearNetworkReplies(); |
71 void signalError(); |
68 void signalError(); |
72 void constructRequest( QString &uri ); |
69 void constructRequest( QString &uri ); |
73 // retrieve URI from Ovi music server |
70 // retrieve URI from Ovi music server |
74 void retrieveInformation( const QString &urlEncoded ); |
71 void retrieveInformation( const QString &urlEncoded ); |
75 |
72 |
76 QString keyValues( QStringList keys, QStringList values ) const; |
73 QString keyValues( QStringList keys, QStringList values ) const; |
77 void handleParsedXML(); |
74 void handleParsedXML(); |
78 |
75 |
79 bool writeImageToFile( const QByteArray &aImageData, const QString &aImageFileName ); |
|
80 |
76 |
81 signals: |
77 signals: |
82 void inspireMeItemAlbumArtReady(); |
78 void inspireMeItemAlbumArtReady(); |
83 void localMusicStoreRetrieved(bool storeUpdated); |
79 void localMusicStoreRetrieved(bool storeUpdated); |
84 void localMusicStoreRetrievalError(); |
80 void localMusicStoreRetrievalError(); |
93 int mDownloadedAlbumArts; |
89 int mDownloadedAlbumArts; |
94 |
90 |
95 QList<QNetworkReply *> mReplys; |
91 QList<QNetworkReply *> mReplys; |
96 QList<int> mThumbnailRequests; |
92 QList<int> mThumbnailRequests; |
97 |
93 |
98 QDomDocument mDomDocument; |
94 QDomDocument mDomDocument; |
99 ThumbnailManager *mThumbnailManager; //owned |
|
100 |
95 |
101 QString mArtist; |
96 QString mArtist; |
102 QString mAlbum; |
97 QString mAlbum; |
103 QString mTitle; |
98 QString mTitle; |
104 QString mMusicStore; |
99 QString mMusicStore; |
105 QStringList mRecommendationAlbumArtsName; |
|
106 |
100 |
107 QStringList mRecommendationSongs; |
101 QStringList mRecommendationSongs; |
108 QStringList mRecommendationArtists; |
102 QStringList mRecommendationArtists; |
109 QStringList mRecommendationAlbumArtsLink; |
103 QStringList mRecommendationAlbumArtsLink; |
110 QMap<QString, HbIcon> mRecommendationAlbumArtsMap; |
104 QMap<QString, HbIcon> mRecommendationAlbumArtsMap; |
113 |
107 |
114 enum RequestType { NoRequest, InspireMeItemsMetadataRequest, InspireMeItemsAlbumArtRequest, LocalStoreRequest }; |
108 enum RequestType { NoRequest, InspireMeItemsMetadataRequest, InspireMeItemsAlbumArtRequest, LocalStoreRequest }; |
115 RequestType mRequestType; |
109 RequestType mRequestType; |
116 int mRecommendationCount; |
110 int mRecommendationCount; |
117 |
111 |
|
112 QSignalMapper *mDownloadSignalMapper; |
|
113 |
118 }; |
114 }; |
119 #endif /* MPQUERYMANAGER_H_ */ |
115 #endif /* MPQUERYMANAGER_H_ */ |
120 |
116 |