17 |
17 |
18 #ifndef THUMBNAILMANAGER_QT_H |
18 #ifndef THUMBNAILMANAGER_QT_H |
19 #define THUMBNAILMANAGER_QT_H |
19 #define THUMBNAILMANAGER_QT_H |
20 |
20 |
21 #include <QObject> |
21 #include <QObject> |
22 #include <qpixmap> |
22 #include <QPixmap> |
23 #include <QImage> |
23 #include <QImage> |
|
24 |
24 #include <QtGlobal> |
25 #include <QtGlobal> |
25 |
26 |
26 class ThumbnailManagerPrivate; |
|
27 class QString; |
27 class QString; |
28 class QSize; |
28 class QSize; |
|
29 |
|
30 class ThumbnailManagerPrivate; |
|
31 class TestThumbnailManager; |
29 |
32 |
30 #ifdef TNMQT_DLL |
33 #ifdef TNMQT_DLL |
31 # define TNM_EXPORT Q_DECL_EXPORT |
34 # define TNM_EXPORT Q_DECL_EXPORT |
32 #else |
35 #else |
33 # define TNM_EXPORT Q_DECL_IMPORT |
36 # define TNM_EXPORT Q_DECL_IMPORT |
254 * cancel the request or change priority. |
256 * cancel the request or change priority. |
255 * |
257 * |
256 */ |
258 */ |
257 TNM_EXPORT int setThumbnail( const QImage& source, const QString& fileName, |
259 TNM_EXPORT int setThumbnail( const QImage& source, const QString& fileName, |
258 void * clientData = NULL, int priority = tnmWrapperPriorityIdle ); |
260 void * clientData = NULL, int priority = tnmWrapperPriorityIdle ); |
|
261 |
|
262 /** |
|
263 * Set a thumbnail for an object file generated from source file. |
|
264 * thumbnailReady() signal will be emited when the operation is complete. |
|
265 * |
|
266 * @param sourceFileName Source file name from which the thumbnail will be created |
|
267 * @param targetFileName Target file name |
|
268 * @param clientData Pointer to arbitrary client data. |
|
269 * This pointer is not used by the API for |
|
270 * anything other than returning it in the |
|
271 * ThumbnailReady callback. |
|
272 * @param priority Priority for this operation |
|
273 * @return Thumbnail request ID or -1 if request failed. This can be used to |
|
274 * cancel the request or change priority. |
|
275 * |
|
276 */ |
|
277 TNM_EXPORT int setThumbnail( const QString& sourceFileName, const QString& targetFileName, |
|
278 const QString& mimeType = QString(""), void * clientData = NULL, |
|
279 int priority = tnmWrapperPriorityIdle ); |
259 |
280 |
260 /** |
281 /** |
261 * Delete all thumbnails for a given object. This is an asynchronous |
282 * Delete all thumbnails for a given object. This is an asynchronous |
262 * operation, which always returns immediately. |
283 * operation, which always returns immediately. |
263 * |
284 * |
298 * @param pixmap An object representing the resulting thumbnail. |
319 * @param pixmap An object representing the resulting thumbnail. |
299 * @param clientData Client data |
320 * @param clientData Client data |
300 * @param id Request ID for the operation |
321 * @param id Request ID for the operation |
301 * @param errorCode error code |
322 * @param errorCode error code |
302 */ |
323 */ |
303 void thumbnailReady( QPixmap , void * , int , int ); |
324 TNM_EXPORT void thumbnailReady( QPixmap , void * , int , int ); |
304 |
325 |
305 /** |
326 /** |
306 * Final thumbnail bitmap generation or loading is complete. |
327 * Final thumbnail bitmap generation or loading is complete. |
307 * |
328 * |
308 * @param image An object representing the resulting thumbnail. |
329 * @param image An object representing the resulting thumbnail. |
309 * @param clientData Client data |
330 * @param clientData Client data |
310 * @param id Request ID for the operation |
331 * @param id Request ID for the operation |
311 * @param errorCode error code |
332 * @param errorCode error code |
312 */ |
333 */ |
313 void thumbnailReady( QImage , void * , int , int ); |
334 TNM_EXPORT void thumbnailReady( QImage , void * , int , int ); |
314 |
335 |
315 protected: |
336 protected: |
316 |
337 |
317 void connectNotify(const char *signal); |
338 void connectNotify(const char *signal); |
318 |
339 |
319 void disconnectNotify(const char *signal); |
340 void disconnectNotify(const char *signal); |
320 |
341 |
321 private: |
342 private: |
322 ThumbnailManagerPrivate* d; |
343 ThumbnailManagerPrivate* d; |
|
344 |
|
345 friend class ThumbnailManagerPrivate; |
|
346 friend class TestThumbnailManager; |
323 }; |
347 }; |
324 |
348 |
325 #endif // THUMBNAILMANAGER_QT |
349 #endif // THUMBNAILMANAGER_QT |