videocollection/videocollectionwrapper/inc/videolistdatamodel_p.h
changeset 52 e3cecb93e76a
parent 24 7d93ee07fb27
equal deleted inserted replaced
47:45e72b57a2fd 52:e3cecb93e76a
    74 	 * 
    74 	 * 
    75 	 * @return int, 0 if ok.
    75 	 * @return int, 0 if ok.
    76 	 */
    76 	 */
    77 	int initialize();
    77 	int initialize();
    78 
    78 
    79 signals:
       
    80 
       
    81     /**
       
    82      * This signal is emitted, when data to some video item changes.
       
    83      * Like for example new thumbnail is fetched.
       
    84      * 
       
    85      * @param startIndex
       
    86      * @param endIndex
       
    87      * 
       
    88      */
       
    89     void dataChanged(const QModelIndex &startIndex, const QModelIndex &endIndex);
       
    90 
       
    91     /**
       
    92      * This signal is emitted, collection notifies details for item has been
       
    93      * fetched and provides a QMap of the details'.
       
    94      */
       
    95     void videoDetailsReady(QVariant &);
       
    96 
       
    97 private slots:
    79 private slots:
    98 
    80 
    99     /**
    81     /**
   100      * This slot is connected to VideoThumbnailData::thumbnailsFetched -signal
    82      * This slot is connected to VideoThumbnailData::thumbnailsFetched -signal
   101      * to get notified when thumbnail(s) for some particular item(s) is ready.
    83      * to get notified when thumbnail(s) for some particular item(s) is ready.
   103      * The indexes of the items are checked and videoDataChanged signal is emitted.
    85      * The indexes of the items are checked and videoDataChanged signal is emitted.
   104      * 
    86      * 
   105      * @param mediaIds: media ids of the items  
    87      * @param mediaIds: media ids of the items  
   106      * 
    88      * 
   107      */
    89      */
   108     void thumbnailsFetchedSlot(QList<TMPXItemId> mediaIds);
    90     void thumbnailsFetchedSlot(QList<TMPXItemId> &mediaIds);
   109     
    91     
   110 private slots: //slots from VideoDataSignalReceiver    
    92 private slots: //slots from VideoDataSignalReceiver    
   111     
    93     
   112     /**
    94     /**
   113      * Signaled by the collection client when there is new video list available.
    95      * Signaled by the collection client when there is new video list available.
   141      * Signaled by the collection client when
   123      * Signaled by the collection client when
   142      * item removal has detected.
   124      * item removal has detected.
   143      * 
   125      * 
   144      * @param itemId id of the removed item
   126      * @param itemId id of the removed item
   145      */
   127      */
   146     void itemDeletedSlot(TMPXItemId itemId);
   128     void itemDeletedSlot(TMPXItemId &itemId);
   147 
   129 
   148     /**
   130     /**
   149      * Signaled by the collection client video deletion request
   131      * Signaled by the collection client video deletion request
   150      * has completed
   132      * has completed
   151      * 
   133      * 
   173      * Signalled when album items are recieved.
   155      * Signalled when album items are recieved.
   174      * 
   156      * 
   175      * @param albumId, Album which items are received.
   157      * @param albumId, Album which items are received.
   176      * @param albumItems, Items belonging to the current album.
   158      * @param albumItems, Items belonging to the current album.
   177      */
   159      */
   178     void albumListAvailableSlot(TMPXItemId albumId, CMPXMediaArray *albumItems);
   160     void albumListAvailableSlot(TMPXItemId &albumId, CMPXMediaArray *albumItems);
   179     
   161     
   180     /**
   162     /**
   181      * Signalled when item has been mofidied.
   163      * Signalled when item has been mofidied.
   182      * 
   164      * 
   183      * @param itemId, item that has been modified.
   165      * @param itemId, item that has been modified.
   184      */
   166      */
   185     void itemModifiedSlot(const TMPXItemId &itemId);
   167     void itemModifiedSlot(const TMPXItemId &itemId);
   186     
   168     
   187     /**
   169     /**
   188      * Signalled when list is complete.
   170      * Signalled when video list is complete.
   189      */
   171      */
   190     void listCompleteSlot();
   172     void videoListCompleteSlot();
       
   173     
       
   174     /**
       
   175      * Signalled when album list is complete.
       
   176      */
       
   177     void albumListCompleteSlot();
   191 
   178 
   192 public: // services 
   179 public: // services 
   193     
   180     
   194     /**
   181     /**
   195      * Returns video count
   182      * Returns video count
   204      * 
   191      * 
   205      * @param index: item position where client wants the id from 
   192      * @param index: item position where client wants the id from 
   206      * 
   193      * 
   207      * @return TMPXItemId item id or invalid TMPXItemId if id not found at that index
   194      * @return TMPXItemId item id or invalid TMPXItemId if id not found at that index
   208      */
   195      */
   209     TMPXItemId getMediaIdFromIndex(int index) const;
   196     const TMPXItemId& getMediaIdFromIndex(const int &index) const;
   210         
   197         
   211     /**
   198     /**
   212      * Returns name of the video from the given index.
   199      * Returns name of the video from the given index.
   213      * If there is no item at that index, empty string is returned.
   200      * If there is no item at that index, empty string is returned.
   214      * 
   201      * 
   215      * @param index: item position where client wants the name from 
   202      * @param index: item position where client wants the name from 
   216      * 
   203      * 
   217      * @return QString name of the item
   204      * @return QString name of the item
   218      */
   205      */
   219     const QString getVideoNameFromIndex(int index)  const;
   206     const QString getVideoNameFromIndex(const int &index)  const;
   220       
   207       
   221     /**
   208     /**
   222      * Returns the thumbnail of the item from given index.
   209      * Returns the thumbnail of the item from given index.
   223      * If there is no item at that index or thumbnail is not yet fetched,
   210      * If there is no item at that index or thumbnail is not yet fetched,
   224      * default thumbnail is returned.
   211      * default thumbnail is returned.
   225      * 
   212      * 
   226      * @param index: item position where client wants the tn from 
   213      * @param index: item position where client wants the tn from 
   227      * 
   214      * 
   228      * @return QIcon thumbnail of the item
   215      * @return QIcon thumbnail of the item
   229      */
   216      */
   230     const QIcon* getVideoThumbnailFromIndex(int index)  const;
   217     const QIcon* getVideoThumbnailFromIndex(const int &index) const;
   231     
   218     
   232     /**
   219     /**
   233      * Returns the value for item count attribute from given index. 
   220      * Returns the value for item count attribute from given index. 
   234 	 * If there is no item at that index, 0 is returned.
   221 	 * If there is no item at that index, 0 is returned.
   235      * 
   222      * 
   236      * @param index: item position where client wants the count from 
   223      * @param index: item position where client wants the count from 
   237      * 
   224      * 
   238      * @return guint32 size in bytes
   225      * @return guint32 size in bytes
   239      */
   226      */
   240     quint32 getCategoryVideoCountFromIndex( int index ) const;
   227     quint32 getCategoryVideoCountFromIndex(const int &index ) const;
   241     
   228     
   242     /**
   229     /**
   243      * Returns the size of the video from given index.
   230      * Returns the size of the video from given index.
   244      * If there is no item at that index, 0 is returned
   231      * If there is no item at that index, 0 is returned
   245      * 
   232      * 
   246      * @param index: item position where client wants the size from 
   233      * @param index: item position where client wants the size from 
   247      * 
   234      * 
   248      * @return guint32 size in bytes
   235      * @return guint32 size in bytes
   249      */
   236      */
   250     quint32 getVideoSizeFromIndex(int index) const;
   237     quint32 getVideoSizeFromIndex(const int &index) const;
   251     
   238     
   252     /**
   239     /**
   253      * Returns the age profile of the video from given index
   240      * Returns the age profile of the video from given index
   254      * If there is no item at that index, 0 is returned
   241      * If there is no item at that index, 0 is returned
   255      * 
   242      * 
   256      * @param index: item position where client wants the size from 
   243      * @param index: item position where client wants the size from 
   257      * 
   244      * 
   258      * @return quint32 age profile in bytes
   245      * @return quint32 age profile in bytes
   259      */
   246      */
   260     quint32 getVideoAgeProfileFromIndex(int index) const;
   247     quint32 getVideoAgeProfileFromIndex(const int &index) const;
   261     
   248     
   262     /**
   249     /**
   263      * Returns the duration of the video from given index.
   250      * Returns the duration of the video from given index.
   264      * If there is no item at that index, 0 is returned
   251      * If there is no item at that index, 0 is returned
   265      * 
   252      * 
   266      * @param index: item position where client wants the duration from 
   253      * @param index: item position where client wants the duration from 
   267      * 
   254      * 
   268      * @return guint32 duration
   255      * @return guint32 duration
   269      */
   256      */
   270     quint32 getVideodurationFromIndex(int index) const;
   257     quint32 getVideodurationFromIndex(const int &index) const;
   271     
   258     
   272     /**
   259     /**
   273      * Returns the duration of the video from given media.
   260      * Returns the duration of the video from given media.
   274      * 
   261      * 
   275      * @param media The video media object. 
   262      * @param media The video media object. 
   283      * 
   270      * 
   284      * @param index: item position where client wants the date from.
   271      * @param index: item position where client wants the date from.
   285      * 
   272      * 
   286      * @return QDate date
   273      * @return QDate date
   287      */
   274      */
   288     QDateTime getVideoDateFromIndex(int index) const;
   275     QDateTime getVideoDateFromIndex(const int &index) const;
   289     
   276     
   290     /**
   277     /**
   291      * Returns the creation/download date of the video
   278      * Returns the creation/download date of the video
   292      * 
   279      * 
   293      * @param media The video media object.
   280      * @param media The video media object.
   300      * 
   287      * 
   301      * @param itemIndex: index of item to be removed
   288      * @param itemIndex: index of item to be removed
   302      * @return TMPXItemId: id of the item marked
   289      * @return TMPXItemId: id of the item marked
   303      *
   290      *
   304      */
   291      */
   305     TMPXItemId markVideoRemoved(const QModelIndex &itemIndex);
   292     const TMPXItemId markVideoRemoved(const QModelIndex &itemIndex);
   306     
   293     
   307     /**
   294     /**
   308      * Removes provided ids from the remove -list
   295      * Removes provided ids from the remove -list
   309      * and restores them into actual container in case
   296      * and restores them into actual container in case
   310      * our current collection level is correct.
   297      * our current collection level is correct.
   315 	/**
   302 	/**
   316      * Returns the file path of the video.
   303      * Returns the file path of the video.
   317      * 
   304      * 
   318      * @param index: item position where client wants the file path from.
   305      * @param index: item position where client wants the file path from.
   319      */
   306      */
   320     const QString getFilePathFromIndex(int index) const;
   307     const QString getFilePathFromIndex(const int &index) const;
   321     
   308     
   322 	/**
   309 	/**
   323      * Returns the file path of the video.
   310      * Returns the file path of the video.
   324      * 
   311      * 
   325      * @param mediaId: id for the item
   312      * @param mediaId: id for the item
   326      */
   313      */
   327     const QString getFilePathForId(TMPXItemId mediaId) const;
   314     const QString getFilePathForId(const TMPXItemId &mediaId);
   328     
   315     
   329     /**
   316     /**
   330      * Checks if the specified item belongs to currently open album.
   317      * Checks if the specified item belongs to currently open album.
   331      * 
   318      * 
   332      * @albumId, Album where the item is to be checked.
   319      * @albumId, Album where the item is to be checked.
   339      * Set album in use.
   326      * Set album in use.
   340      * 
   327      * 
   341      * @param albumId, Album to set in use.
   328      * @param albumId, Album to set in use.
   342      * @return None.
   329      * @return None.
   343      */
   330      */
   344     void setAlbumInUse(TMPXItemId albumId);
   331     void setAlbumInUse(const TMPXItemId &albumId);
   345     
   332     
   346     /**
   333     /**
   347      * removes provided items from album provided
   334      * removes provided items from album provided
   348      * 
   335      * 
   349      * @param albumId album from where to remove
   336      * @param albumId album from where to remove
   350      * @param items to remove
   337      * @param items to remove
   351      * 
   338      * 
   352      * @return count of item removed;
   339      * @return count of item removed;
   353      */
   340      */
   354     int removeItemsFromAlbum(TMPXItemId &albumId, const QList<TMPXItemId> &items);
   341     int removeItemsFromAlbum(const TMPXItemId &albumId, const QList<TMPXItemId> &items);
   355 
   342 
   356 private: // private methods
   343 private: // private methods
   357   
   344   
   358     /**
   345     /**
   359      * private default constructor definition
   346      * private default constructor definition
   401      * Album data changed, resets album data from array provided
   388      * Album data changed, resets album data from array provided
   402      * 
   389      * 
   403      * @param albumId id of album
   390      * @param albumId id of album
   404      * @param videoarray array of videos in album 
   391      * @param videoarray array of videos in album 
   405      */
   392      */
   406     void albumDataChangedL(TMPXItemId albumId, CMPXMediaArray *videoArray);
   393     void albumDataChangedL(TMPXItemId &albumId, CMPXMediaArray *videoArray);
   407 
   394 
   408     /**
   395     /**
   409      * Called when an album has been removed.
   396      * Called when an album has been removed.
   410      * 
   397      * 
   411      * @param albumId, Album which items are received.
   398      * @param albumId, Album which items are received.
   412      */
   399      */
   413     void albumRemoved(TMPXItemId albumId);
   400     void albumRemoved(TMPXItemId &albumId);
   414    
   401    
   415     /**
   402     /**
   416      * Called when a video has been removed.
   403      * Called when a video has been removed.
   417      * 
   404      * 
   418      * @param videoId id of the removed video
   405      * @param videoId id of the removed video
   419      */
   406      */
   420     void videoDeleted(TMPXItemId videoId);
   407     void videoDeleted(TMPXItemId &videoId);
   421 
   408 
   422 private:
   409 private:
   423     
   410     
   424     /**
   411     /**
   425      * Pointer to the public class
   412      * Pointer to the public class