videocollection/videocollectionwrapper/inc/videothumbnaildata.h
changeset 34 bbb98528c666
parent 30 4f111d64a341
child 50 21fe8338c6bf
equal deleted inserted replaced
33:48e74db5d516 34:bbb98528c666
    16 
    16 
    17 #ifndef __VIDEOTHUMBNAILDATA_H__
    17 #ifndef __VIDEOTHUMBNAILDATA_H__
    18 #define __VIDEOTHUMBNAILDATA_H__
    18 #define __VIDEOTHUMBNAILDATA_H__
    19 
    19 
    20 // INCLUDES
    20 // INCLUDES
    21 #include <QObject>
    21 #include <qobject.h>
    22 #include <QHash>
    22 #include <qicon.h>
    23 #include <QPair>
    23 #include <qpointer.h>
    24 #include <QIcon>
       
    25 #include <QSet>
       
    26 #include <QPointer>
       
    27 #include <mpxitemid.h>
    24 #include <mpxitemid.h>
    28 
    25 
    29 #include "videocollectionexport.h"
    26 #include "videocollectionexport.h"
    30 
    27 
    31 // FORWARD DECLARATIONS
    28 // FORWARD DECLARATIONS
    32 class VideoThumbnailDataPrivate;
    29 class VideoThumbnailDataPrivate;
       
    30 class VideoSortFilterProxyModel;
    33 
    31 
    34 // CLASS DECLARATIONS
    32 // CLASS DECLARATIONS
    35 
    33 
    36 class VIDEOCOLLECTION_DLL_EXPORT VideoThumbnailData : public QObject
    34 class VIDEOCOLLECTION_DLL_EXPORT VideoThumbnailData : public QObject
    37 {
    35 {
    62      *
    60      *
    63      * @return The singleton instance.
    61      * @return The singleton instance.
    64      *
    62      *
    65      */
    63      */
    66     static VideoThumbnailData &instance();
    64     static VideoThumbnailData &instance();
    67 
       
    68     /**
       
    69      * Method starts fetching thumbnail for the video specified by given mediaId
       
    70      * Media IDs are used as a key identification in the thumbnail map where data is
       
    71      * collected. Id is passed to thumbnail manager as internal data and when
       
    72      * thumbnail is fetched and thumbnailReadySlot is signaled, id is used to notify
       
    73      * client about which item's thumbnail is ready.
       
    74      *
       
    75      * If thumbnail fetching is started succesfully, method saves thumbnail item
       
    76      * into local repository with default thumbnail data.
       
    77      *
       
    78      * @param mediaId media id for which to start fetching thumbnail
       
    79      * @param priority priority for the fetch
       
    80      *
       
    81      * @return int: thumbnail id or -1 if fetch starting fails.
       
    82      *
       
    83      */
       
    84     int startFetchingThumbnail(int mediaId, int priority);
       
    85     
    65     
    86     /**
    66     /**
    87      * Method removes thumbnail data from the local repository.
    67      * Method removes thumbnail data from the local repository.
    88      *
    68      *
    89      * @param mediaId id for media whose thumbnail is to be removed
    69      * @param mediaId id for media whose thumbnail is to be removed
   106      *
    86      *
   107      */
    87      */
   108     const QIcon* getThumbnail(TMPXItemId mediaId);
    88     const QIcon* getThumbnail(TMPXItemId mediaId);
   109 
    89 
   110     /**
    90     /**
   111      * Starts background thumbnail fetching.
    91      * Starts background thumbnail fetching, the model used for the background fetching
       
    92      * is also changed.
   112      *
    93      *
       
    94      * @param model model of the items for the fetching.
   113      * @param fetchIndex index where to start the background thumbnail fetching.
    95      * @param fetchIndex index where to start the background thumbnail fetching.
   114      *  
    96      *  
   115      */
    97      */
   116     void startBackgroundFetching(int fetchIndex);
    98     void startBackgroundFetching(VideoSortFilterProxyModel *model, int fetchIndex);
   117     
    99     
   118     /**
   100     /**
   119      * Enables or disables thumbnail background fetching. Default is enabled.
   101      * Enables or disables thumbnail background fetching. Default is enabled.
   120      * 
   102      * 
   121      * @param enable true enables and false disables thumbnail background fetching.
   103      * @param enable true enables and false disables thumbnail background fetching.
   122      */
   104      */
   123     void enableBackgroundFetching(bool enable);
   105     void enableBackgroundFetching(bool enable);
       
   106     
       
   107     /**
       
   108      * Enables or disables thumbnail creation. Default is enabled. Thumbnails
       
   109      * that have been already generated are fetched still.  
       
   110      * 
       
   111      * @param enable true enables and false disables thumbnail creation.
       
   112      */
       
   113     void enableThumbnailCreation(bool enable);    
   124     
   114     
   125     /**
   115     /**
   126      * Frees allocated data for thumbnails and cancels ongoing fetches.
   116      * Frees allocated data for thumbnails and cancels ongoing fetches.
   127      * 
   117      * 
   128      */
   118      */