videocollection/mpxmyvideoscollection/inc/vcxmyvideosopenhandler.h
branchRCL_3
changeset 16 67eb01668b0e
parent 0 96612d01cf9f
--- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosopenhandler.h	Tue May 25 12:44:54 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosopenhandler.h	Wed Jun 09 09:44:23 2010 +0300
@@ -11,11 +11,11 @@
 *
 * Contributors:
 *
-* Description:   Handles collection Open operation related functionality*
+* Description:  Handles collection Open operation related functionality
+*
 */
 
 
-
 #ifndef VCXMYVIDEOSOPENHANDLER_H
 #define VCXMYVIDEOSOPENHANDLER_H
 
@@ -23,13 +23,15 @@
 class MMPXCollectionPluginObserver;
 class CVcxMyVideosMdsDb;
 
+#include "vcxmyvideosmdsdb.h"
 /**
  */
-NONSHARABLE_CLASS( CVcxMyVideosOpenHandler ) : public CBase
+NONSHARABLE_CLASS( CVcxMyVideosOpenHandler ) : public CBase, public MVcxMyVideosMdsAlbumsObserver
     {
     friend class CVcxMyVideosVideoCache;
     
 public:
+    
     /**
     * Two-phased constructor
     */
@@ -52,18 +54,62 @@
     void OpenL( const CMPXCollectionPath& aPath );
 
     /**
-    * Leaving version of HandleCreateVideoListResp.
-    * Handler function for list fetching events. This callback is called as a response
-    * to iCache.CreateVideoListL().
-    *
-    * @param aVideoList           List of videos fetched from MDS.
-    * @param aNewItemsStartIndex  Start position for the new items added.
-    * @param aComplete            ETrue if list is complete and no more items are expected,
-    *                             EFalse if there are more to come.
-    */
+     * From MVcxMyVideosMdsAlbumsObserver.
+     */
+    void HandleAlbumOpenL();
+
+    /**
+     * From MVcxMyVideosMdsAlbumsObserver, no implementation.
+     */
+    void HandleGetAlbumsResp( CMPXMedia* /*aAlbumList*/ ) {}
+
+    /**
+     * From MVcxMyVideosMdsAlbumsObserver, no implementation.
+     */
+    void HandleGetAlbumContentIdsResp( TUint32 /*aAlbumId*/,
+            RArray<TVcxMyVideosAlbumVideo>& /*aContentArray*/ ) {}
+
+    /**
+     * From MVcxMyVideosMdsAlbumsObserver, no implementation.
+     */
+    void HandleAddVideosToAlbumResp( CMPXMedia* /*aCmd*/,
+            RPointerArray<CMdEInstanceItem>& /*aItemArray*/ ) {}
+
+    /**
+     * From MVcxMyVideosMdsAlbumsObserver, no implementation.
+     */
+    void HandleRemoveRelationsResp( RArray<TUint32>& /*aRelationIds*/,
+            RArray<TUint32>& /*aResults*/ ) {}
+
+    /**
+     * From MVcxMyVideosMdsAlbumsObserver, no implementation.
+     */
+    void HandleRemoveAlbumsResp( CMPXMedia* /*aCmd*/,
+            RArray<TUint32>& /*aResultIds*/ ) {}
+
+    /**
+     * From MVcxMyVideosMdsAlbumsObserver, no implementation.
+     */
+    void HandleRelationEvent( TObserverNotificationType /*aType*/,
+            const RArray<TMdERelation>& /*aRelationArray*/ ) {}
+    
+    /**
+     * Called as a response to GetAlbumContentVideosL.
+     * 
+     * @param aAlbumId           ID of the album containing the result videos.
+     * @param aVideoList         Media containing array of videos.
+     * @param aError             Error code in case of failure.
+     * @param aFirstNewItemIndex Index of the first new item.
+     * @param aNewItemCount      How many new items in the query since the last results.
+     * @param aComplete          ETrue if query is complete, EFalse if there is more to come.
+     */
+    void HandleGetAlbumContentVideosResp( TUint32 aAlbumId, CMPXMedia& aVideoList,
+            TInt aError, TInt aFirstNewItemIndex, TInt aNewItemCount, TBool aComplete );
+
+
     void DoHandleCreateVideoListRespL(
             CMPXMedia* aVideoList, TInt aNewItemsStartIndex, TBool aComplete );
-            
+
 private:
     /**
     * 2nd-phase Constructor
@@ -77,6 +123,35 @@
             CVcxMyVideosVideoCache& aCache,
             CVcxMyVideosMdsDb& aMds );
 
+    /**
+     * Opens category.
+     * 
+     * @param aCategoryId  Category to open.
+     */
+    void OpenCategoryL( TUint32 aCategoryId );
+
+    /**
+     * Leaving version of HandleGetAlbumContentVideosResp.
+     */
+    void HandleGetAlbumContentVideosRespL(
+            TUint32 aAlbumId, CMPXMedia& /*aVideoList*/, TInt aError,
+            TInt /*aFirstNewItemIndex*/, TInt /*aNewItemCount*/, TBool aComplete );
+public:
+
+    /**
+     * If album is opened when the album list is not yet complete,
+     * then the album ID which is tried to open is stored here.
+     * The open processing is continued when album list is received
+     * from MDS. There can't be several album opens pending since
+     * we do not call HandleOpen before we get the album list.
+     */
+    TUint32 iPendingAlbumOpenId;
+
+    /**
+     * for testing, temp
+     */
+    CMPXMedia* iAlbumVideoList;
+
 private: // data
 
     /**
@@ -108,6 +183,26 @@
     * This is in sync with iCategoryIdsBeingOpened.
     */
     RArray<CMPXMedia*> iVideoListsBeingOpened;
+
+    /**
+    * The album IDs being opened are stored here. These values are used
+    * to filter list when items arrive from MDS.
+    * This is in sync with iAlbumVideoListsBeingOpened.
+    */
+    RArray<TInt> iAlbumIdsBeingOpened;
+
+    /**
+    * Video lists for albums being opened are stored here.
+    * This is in sync with iAlbumIdsBeingOpened.
+    */
+    RArray<CMPXMedia*> iAlbumVideoListsBeingOpened;
+    
+    /**
+     * Path being opened is stored here for the HandleOpenL call.
+     * Not Own.
+     */
+    const CMPXCollectionPath* iPath;
+    
     };
 
 #endif // VCXMYVIDEOSACTIVETASK_H