|
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: Music Player collection album art manager. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef LOGSTHUMBNAILMANAGER_H |
|
20 #define LOGSTHUMBNAILMANAGER_H |
|
21 |
|
22 #include <QObject> |
|
23 #include <qcache.h> |
|
24 #include <QMap> |
|
25 #include <QQueue> |
|
26 #include <QPair> |
|
27 #include <QIcon> |
|
28 #include <QTimer> |
|
29 |
|
30 class ThumbnailManager; |
|
31 |
|
32 class LogsThumbIconManager : public QObject |
|
33 { |
|
34 Q_OBJECT |
|
35 |
|
36 public: |
|
37 |
|
38 explicit LogsThumbIconManager(QObject *parent=0); |
|
39 virtual ~LogsThumbIconManager(); |
|
40 |
|
41 QIcon& contactIcon(const QString &avatarPath, int index); |
|
42 void cancel(); |
|
43 QIcon& defaultIcon(); |
|
44 |
|
45 signals: |
|
46 void contactIconReady(int index); |
|
47 |
|
48 public slots: |
|
49 void thumbnailReady(const QPixmap& pixmap, void *data, int id, int error); |
|
50 void thumbnailLoad(); |
|
51 void timerTimeout(); |
|
52 |
|
53 private: |
|
54 ThumbnailManager *mThumbnailManager; |
|
55 QCache<QString, QIcon> mImageCache; |
|
56 QMap<int, QString> mTnmReqMap; |
|
57 |
|
58 QQueue< QPair<QString, int> > mRequestQueue; |
|
59 int mQueueCount; |
|
60 QTimer* mTimer; |
|
61 QIcon* mDefaultIcon; |
|
62 |
|
63 private: |
|
64 |
|
65 friend class UT_LogsMatchesModel; |
|
66 friend class UT_LogsThumbnailManager; |
|
67 |
|
68 }; |
|
69 |
|
70 #endif // LOGSTHUMBNAILMANAGER_H |
|
71 |