diff -r dec420019252 -r cf5481c2bc0b videocollection/mpxmyvideoscollection/inc/vcxmyvideosopenhandler.h --- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideosopenhandler.h Tue Feb 02 00:12:10 2010 +0200 +++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideosopenhandler.h Fri Apr 16 14:59:52 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,24 @@ class MMPXCollectionPluginObserver; class CVcxMyVideosMdsDb; +#include "vcxmyvideosmdsdb.h" + +enum TVcxItemType + { + EVcxItemTypeNone, + EVcxItemTypeVideo, + EVcxItemTypeCategory, + EVcxItemTypeAlbum + }; + /** */ -NONSHARABLE_CLASS( CVcxMyVideosOpenHandler ) : public CBase +NONSHARABLE_CLASS( CVcxMyVideosOpenHandler ) : public CBase, public MVcxMyVideosMdsAlbumsObserver { friend class CVcxMyVideosVideoCache; public: + /** * Two-phased constructor */ @@ -52,18 +63,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& /*aContentArray*/ ) {} + + /** + * From MVcxMyVideosMdsAlbumsObserver, no implementation. + */ + void HandleAddVideosToAlbumResp( CMPXMedia* /*aCmd*/, + RPointerArray& /*aItemArray*/ ) {} + + /** + * From MVcxMyVideosMdsAlbumsObserver, no implementation. + */ + void HandleRemoveRelationsResp( RArray& /*aRelationIds*/, + RArray& /*aResults*/ ) {} + + /** + * From MVcxMyVideosMdsAlbumsObserver, no implementation. + */ + void HandleRemoveAlbumsResp( CMPXMedia* /*aCmd*/, + RArray& /*aResultIds*/ ) {} + + /** + * From MVcxMyVideosMdsAlbumsObserver, no implementation. + */ + void HandleRelationEvent( TObserverNotificationType /*aType*/, + const RArray& /*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 +132,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 +192,26 @@ * This is in sync with iCategoryIdsBeingOpened. */ RArray 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 iAlbumIdsBeingOpened; + + /** + * Video lists for albums being opened are stored here. + * This is in sync with iAlbumIdsBeingOpened. + */ + RArray iAlbumVideoListsBeingOpened; + + /** + * Path being opened is stored here for the HandleOpenL call. + * Not Own. + */ + const CMPXCollectionPath* iPath; + }; #endif // VCXMYVIDEOSACTIVETASK_H