imagehandling_plat/thumbnailmanager_api/inc/thumbnailmanager_qt.h
branchGCC_SURGE
changeset 32 a0ee3f735f8b
parent 30 b67379558a75
equal deleted inserted replaced
26:ea43e3e86079 32:a0ee3f735f8b
    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
    40 class ThumbnailManager : public QObject
    43 class ThumbnailManager : public QObject
    41     {
    44     {
    42     Q_OBJECT
    45     Q_OBJECT
    43 
    46 
    44 public:
    47 public:
    45 
       
    46 
    48 
    47     /** Thumbnail size. */
    49     /** Thumbnail size. */
    48     enum ThumbnailSize
    50     enum ThumbnailSize
    49     {
    51     {
    50         /**
    52         /**
   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