camerauis/cameraxui/cxengine/tsrc/unit/system_include/thumbnailmanager_qt.h
changeset 43 0e652f8f1fbd
parent 19 d9aefe59d544
equal deleted inserted replaced
28:3075d9b614e6 43:0e652f8f1fbd
    19 #define THUMBNAILMANAGER_QT_H
    19 #define THUMBNAILMANAGER_QT_H
    20 
    20 
    21 #include <qobject>
    21 #include <qobject>
    22 #include <QPixmap.h>
    22 #include <QPixmap.h>
    23 #include <QStringList>
    23 #include <QStringList>
       
    24 #include <QTimer>
    24 
    25 
    25 
    26 
    26 class  ThumbnailManager : public QObject
    27 class  ThumbnailManager : public QObject
    27     {
    28     {
    28     Q_OBJECT
    29     Q_OBJECT
    61      */
    62      */
    62     int getThumbnail(const QString& fileName, void * clientData = NULL, 
    63     int getThumbnail(const QString& fileName, void * clientData = NULL, 
    63             int priority = 0);
    64             int priority = 0);
    64 
    65 
    65     /**
    66     /**
       
    67      * Set a thumbnail for an object file generated from pixmap delivered.
       
    68      * thumbnailReady() signal will be emited when the operation is complete.
       
    69      *
       
    70      * @param source             QImage from which the thumbnail will be created
       
    71      * @param fileName           file name
       
    72      * @param clientData         Pointer to arbitrary client data.
       
    73      *                           This pointer is not used by the API for
       
    74      *                           anything other than returning it in the
       
    75      *                           ThumbnailReady callback.
       
    76      * @param priority           Priority for this operation
       
    77      * @return                   Thumbnail request ID or -1 if request failed. This can be used to
       
    78      *                           cancel the request or change priority.
       
    79      *
       
    80      */
       
    81     int setThumbnail( const QImage& source, const QString& fileName,
       
    82             void * clientData = NULL, int priority = 0 );
       
    83 
       
    84     /**
    66      * Cancel a thumbnail operation.
    85      * Cancel a thumbnail operation.
    67      *
    86      *
    68      * @param id      Request ID for the operation to be cancelled.
    87      * @param id      Request ID for the operation to be cancelled.
    69      * @return         true if cancelling was successful.
    88      * @return         true if cancelling was successful.
    70      */
    89      */
    80      * @param id         Request ID for the operation
    99      * @param id         Request ID for the operation
    81      * @param errorCode  error code
   100      * @param errorCode  error code
    82      */
   101      */
    83     void thumbnailReady( QPixmap , void * , int , int );    
   102     void thumbnailReady( QPixmap , void * , int , int );    
    84 
   103 
       
   104 private slots:
       
   105     void emulateThumbnailReady();
       
   106 
    85 private:
   107 private:
    86     int mCurrentThumbnailId;
   108     int mCurrentThumbnailId;
    87     QList<int> mThumbnailManagerIds;
   109     QList<int> mThumbnailManagerIds;
       
   110     QTimer mTimer;
    88 };
   111 };
    89 
   112 
    90 #endif // THUMBNAILMANAGER_QT
   113 #endif // THUMBNAILMANAGER_QT