|
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: copy of normally used "system" file for thumbnailmanager for qt |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef THUMBNAILMANAGER_QT_H |
|
19 #define THUMBNAILMANAGER_QT_H |
|
20 |
|
21 #include <qobject> |
|
22 #include <QPixmap.h> |
|
23 #include <QStringList> |
|
24 |
|
25 |
|
26 class ThumbnailManager : public QObject |
|
27 { |
|
28 Q_OBJECT |
|
29 |
|
30 public: |
|
31 |
|
32 /** |
|
33 * Constructor |
|
34 * |
|
35 * @param parentPtr parent |
|
36 */ |
|
37 ThumbnailManager( QObject* parentPtr = NULL ); |
|
38 |
|
39 /** |
|
40 * Destructor |
|
41 */ |
|
42 virtual ~ThumbnailManager(); |
|
43 |
|
44 /** |
|
45 * Get a thumbnail for an object file. If a thumbnail already exists, it |
|
46 * is loaded and if a thumbnail does not exist, it is created |
|
47 * transparently. If thumbnail loadinf fails thumbnailReady signal is emited |
|
48 * with null pixmap and error code. |
|
49 * |
|
50 * @param fileName Source object or file |
|
51 * @param clientData Pointer to arbitrary client data. |
|
52 * This pointer is not used by the API for |
|
53 * anything other than returning it in the |
|
54 * ThumbnailReady signal. |
|
55 * @param priority Priority for this operation |
|
56 * @return Thumbnail request ID or -1 if request failed. This can be used to |
|
57 * cancel the request or change priority. |
|
58 * The ID is specific to this tnm |
|
59 * instance and may not be shared with other |
|
60 * instances. |
|
61 */ |
|
62 int getThumbnail(const QString& fileName, void * clientData = NULL, |
|
63 int priority = 0); |
|
64 |
|
65 /** |
|
66 * Cancel a thumbnail operation. |
|
67 * |
|
68 * @param id Request ID for the operation to be cancelled. |
|
69 * @return true if cancelling was successful. |
|
70 */ |
|
71 bool cancelRequest(int id); |
|
72 |
|
73 |
|
74 signals: |
|
75 /** |
|
76 * Final thumbnail bitmap generation or loading is complete. |
|
77 * |
|
78 * @param pixmap An object representing the resulting thumbnail. |
|
79 * @param clientData Client data |
|
80 * @param id Request ID for the operation |
|
81 * @param errorCode error code |
|
82 */ |
|
83 void thumbnailReady( QPixmap , void * , int , int ); |
|
84 |
|
85 private: |
|
86 int mCurrentThumbnailId; |
|
87 QList<int> mThumbnailManagerIds; |
|
88 }; |
|
89 |
|
90 #endif // THUMBNAILMANAGER_QT |