17 #ifndef IRHISTORYMODEL_H_ |
17 #ifndef IRHISTORYMODEL_H_ |
18 #define IRHISTORYMODEL_H_ |
18 #define IRHISTORYMODEL_H_ |
19 |
19 |
20 #include <QAbstractItemModel> |
20 #include <QAbstractItemModel> |
21 |
21 |
22 class IRQSongHistoryEngine; |
|
23 class IRQSongHistoryInfo; |
|
24 class HbIcon; |
22 class HbIcon; |
|
23 class IRQPreset; |
|
24 class channelHistoryWrapper; |
|
25 class urlInfoWrapper; |
|
26 class IRLogoProvider; |
|
27 class IRQIsdsClient; |
|
28 class QTimer; |
25 |
29 |
26 class IRHistoryModel : public QAbstractListModel |
30 class IRHistoryModel : public QAbstractListModel |
27 { |
31 { |
28 Q_OBJECT |
32 Q_OBJECT |
29 public: |
33 public: |
31 ~IRHistoryModel(); |
35 ~IRHistoryModel(); |
32 |
36 |
33 int rowCount(const QModelIndex &aParent = QModelIndex()) const; |
37 int rowCount(const QModelIndex &aParent = QModelIndex()) const; |
34 QVariant data(const QModelIndex &aIndex, int aRole = Qt::DisplayRole) const; |
38 QVariant data(const QModelIndex &aIndex, int aRole = Qt::DisplayRole) const; |
35 |
39 |
36 IRQSongHistoryInfo* getHistoryInfo(int aIndex); |
40 IRQPreset* getHistoryInfo(int aIndex); |
37 void clearAllList(); |
41 void clearAllHistory(); |
38 bool checkHistoryUpdate(); |
42 bool checkHistoryUpdate(); |
39 void clearAndDestroyLogos(); |
43 bool deleteHistory(int aIndex); |
40 QString getImageUrl(int aRow) const; |
44 |
41 void setLogo(HbIcon *aIcon, int aIndex); |
45 void startDownloadingLogo(); |
42 bool deleteOneItem(int aIndex); |
46 void stopDownloadingLogo(); |
43 |
47 |
44 signals: |
48 signals: |
45 void modelChanged(); |
49 void modelChanged(); |
46 |
50 |
|
51 private slots: |
|
52 void downloadNextLogo(); |
|
53 void logoData(const QByteArray &aLogoData); |
|
54 |
47 private: |
55 private: |
48 void getAllList(); |
56 void refreshModel(); |
49 |
57 void clearModel(); |
|
58 |
|
59 void clearAndDestroyLogos(); |
|
60 QString getImageUrl(int aRow) const; |
|
61 void setLogo(HbIcon *aIcon, int aIndex); |
|
62 |
|
63 bool isLogoReady(int aIndex) const; |
|
64 void updateIconIndexArray(); |
|
65 |
50 private: |
66 private: |
51 QList<IRQSongHistoryInfo *> iHistoryList; |
67 QList<IRQPreset *> iHistoryList; |
52 IRQSongHistoryEngine *iHistoryEngine; |
68 channelHistoryWrapper *iHistoryEngine; |
53 QMap<int, HbIcon*> iLogos; |
69 urlInfoWrapper *iUrlInfoWrapper; |
54 HbIcon *iStationLogo; |
70 QList<HbIcon*> iLogos; |
|
71 HbIcon *iStationLogo; |
|
72 |
|
73 QList<int> iIconIndexArray; |
|
74 IRQIsdsClient *iIsdsClient; |
|
75 IRLogoProvider *iLogoProvider; |
|
76 QTimer *iTimer; |
55 }; |
77 }; |
56 |
78 |
57 #endif /* IRHISTORYMODEL_H_ */ |
79 #endif /* IRHISTORYMODEL_H_ */ |