# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1286969676 -10800 # Node ID 375929f879c2e79428ad786ddcf6caf564dafe85 # Parent 3eb824b18d6751cfcd96ce45c93580c12c219895 Revision: 201039 Kit: 201041 diff -r 3eb824b18d67 -r 375929f879c2 filedetails/filedetailsdialog/src/MPFileDetails.cpp --- a/filedetails/filedetailsdialog/src/MPFileDetails.cpp Wed Sep 15 12:15:24 2010 +0300 +++ b/filedetails/filedetailsdialog/src/MPFileDetails.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -15,7 +15,7 @@ */ -// Version : %version: 9 % +// Version : %version: 8 % // INCLUDE FILES @@ -35,6 +35,33 @@ : iSeekable( ETrue ), iDRMExpireConstraint( EMediaPlayerNone ), iDRMhasInfoURL(EFalse) { MPX_ENTER_EXIT(_L("CMPFileDetails::CMPFileDetails()")); + + //Initializing to make sure no garbage in the variables + iTitle = NULL; + iFileName = NULL; + iFilePath = NULL; + iUrl = NULL; + iFormat = NULL; + iCopyright = NULL; + iArtist = NULL; + iAlbum = NULL; + iYear = NULL; + + iOriginalArtist = NULL; + iAlbumTrack = NULL; + iGenre = NULL; + iComposer = NULL; + iAudioFileWebPage = NULL; + iComment = NULL; + iProvider = NULL; + iDescription = NULL; + + iArtistXpcs = NULL; + iTitleXpcs = NULL; + iAlbumXpcs = NULL ; + iInfoXpcs = NULL; + + iDRMInfoURL = NULL; } // ----------------------------------------------------------------------------- diff -r 3eb824b18d67 -r 375929f879c2 filedetails/filedetailsdialog/src/MPFileDetailsDialog.cpp --- a/filedetails/filedetailsdialog/src/MPFileDetailsDialog.cpp Wed Sep 15 12:15:24 2010 +0300 +++ b/filedetails/filedetailsdialog/src/MPFileDetailsDialog.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -15,7 +15,7 @@ */ -// Version : %version: 21 % +// Version : %version: 20 % // INCLUDE FILES #include @@ -310,7 +310,7 @@ } else if (!metaData->Name().CompareF(KMPArtist) || !metaData->Name().Compare(KMPAuthor)) { - fileDetails->iArtist = metaData->Value().AllocL(); + fileDetails->iArtist = metaData->Value().Alloc(); } else if (!metaData->Name().CompareF(KMPTitle)) { @@ -1751,7 +1751,7 @@ if( !aBuf && aDetail.Length()) { - aBuf = HBufC::NewL( aDetail.Length() ); + aBuf = HBufC::New( aDetail.Length() ); aBuf->Des().Copy( aDetail ); } } diff -r 3eb824b18d67 -r 375929f879c2 inc/IptvDebug.h --- a/inc/IptvDebug.h Wed Sep 15 12:15:24 2010 +0300 +++ b/inc/IptvDebug.h Wed Oct 13 14:34:36 2010 +0300 @@ -173,7 +173,7 @@ #else // ARMV5 BUILD: -#define IPTV_LOGGING_METHOD 2 // RDebug is default with target device +#define IPTV_LOGGING_METHOD 1 // Flogger is default with target device #endif diff -r 3eb824b18d67 -r 375929f879c2 inc/mpxvideo_debug.h --- a/inc/mpxvideo_debug.h Wed Sep 15 12:15:24 2010 +0300 +++ b/inc/mpxvideo_debug.h Wed Oct 13 14:34:36 2010 +0300 @@ -15,7 +15,7 @@ */ -// Version : %version: ou1cpsw#4.1.1 % +// Version : %version: ou1cpsw#3 % @@ -35,13 +35,13 @@ // #define _MPX_FILE_LOGGING_ -#ifndef _DEBUG - #define FU_DEBUG +#ifdef _DEBUG + #define FU_DEBUG RDebug::Print #else #ifdef _MPX_FILE_LOGGING_ #define FU_DEBUG MPXDebug::FileLog #else - #define FU_DEBUG RDebug::Print + #define FU_DEBUG #endif #endif diff -r 3eb824b18d67 -r 375929f879c2 mediasettings/mediasettingsengine/group/MPSettROPModel.mmp --- a/mediasettings/mediasettingsengine/group/MPSettROPModel.mmp Wed Sep 15 12:15:24 2010 +0300 +++ b/mediasettings/mediasettingsengine/group/MPSettROPModel.mmp Wed Oct 13 14:34:36 2010 +0300 @@ -16,7 +16,7 @@ -// Version : %version: 8 % +// Version : %version: 6 % diff -r 3eb824b18d67 -r 375929f879c2 tsrc/testing/ini/01-unit/TestFramework.ini --- a/tsrc/testing/ini/01-unit/TestFramework.ini Wed Sep 15 12:15:24 2010 +0300 +++ b/tsrc/testing/ini/01-unit/TestFramework.ini Wed Oct 13 14:34:36 2010 +0300 @@ -98,6 +98,9 @@ TestCaseFile= c:\TestFramework\ui_videoplaybackcontrolstest.cfg TestCaseFile= c:\TestFramework\ui_userinputhandlertest.cfg TestCaseFile= c:\TestFramework\mpxvideoplayertest.cfg +TestCaseFile= c:\TestFramework\ut_collectionplugintest.cfg +TestCaseFile= c:\TestFramework\VcxMyVideosCollectionUtilTest.cfg +TestCaseFile= c:\TestFramework\VcxMyVideosMdsDbTest.cfg [End_Module] #TestCaseFile= c:\TestFramework\ui_VcxHgMyVideosMainViewTest.cfg diff -r 3eb824b18d67 -r 375929f879c2 tsrc/testing/sis/fusion_engine_tests.pkg --- a/tsrc/testing/sis/fusion_engine_tests.pkg Wed Sep 15 12:15:24 2010 +0300 +++ b/tsrc/testing/sis/fusion_engine_tests.pkg Wed Oct 13 14:34:36 2010 +0300 @@ -132,42 +132,6 @@ "../../../../videoutils/videoutils_plat/videoconnutility_api/tsrc/conf/VCXConnUtilTest.inc" - "C:/TestFramework/VCXConnUtilTest.inc" "../../../../videoutils/videoutils_plat/videoconnutility_api/tsrc/conf/VCXConnUtilTestHelium.cfg" - "C:/TestFramework/VCXConnUtilTestHelium.cfg" - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; VIDEOPLAYER UNIT TESTS - -; VIDEOHELIX -;"/epoc32/release/armv5/udeb/videohelixtest.dll" - "!:/sys/bin/videohelixtest.dll" -;"../../../videoplayback/videohelix/tsrc/ut_videohelixtest/conf/videohelixtest.cfg" - "c:/testframework/videohelixtest.cfg" -;"../../../videoplayback/videohelix/tsrc/ut_videohelixtest/data/mmc/dcf.odf" - "e:/testing/data/dcf.odf" -;"../../../videoplayback/videohelix/tsrc/ut_videohelixtest/data/mmc/sdp_test.sdp" - "e:/testing/data/sdp_test.sdp" -;"../../../videoplayback/videohelix/tsrc/ut_videohelixtest/data/mmc/vhpp_test.3gp" - "e:/testing/data/vhpp_test.3gp" - -; MPXVIDEOPLAYER -;"/epoc32/release/armv5/udeb/mpxvideoplayertest.dll" - "!:/sys/bin/mpxvideoplayertest.dll" -;"../../../videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/conf/mpxvideoplayertest.cfg" - "c:/testframework/mpxvideoplayertest.cfg" - -;"../../../videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/local.3gp" - "e:/testing/data/local.3gp" -;"../../../videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/sdp_test.sdp" - "e:/testing/data/sdp_test.sdp" -;"../../../videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_local_hw.ram" - "e:/testing/data/test_local.ram" -;"../../../videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_multilocal_hw.ram" - "e:/testing/data/test_multilocal.ram" -;"../../../videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_streaming.ram" - "e:/testing/data/test_streaming.ram" -;"../../../videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_multilink_v2.asx" - "e:/testing/data/test_multilink_v2.asx" -;"../../../videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_seekSingle_v3.asx" - "e:/testing/data/test_seekSingle_v3.asx" - -; VIDEOPLAYBACKCONTROLS -;"/epoc32/release/armv5/udeb/ui_videoplaybackcontrolstest.dll" - "!:/sys/bin/ui_videoplaybackcontrolstest.dll" -;"/epoc32/data/z/resource/apps/mpxvideoplaybackcontrols.rsc" - "!:/resource/apps/mpxvideoplaybackcontrols.rsc" -;"/epoc32/data/z/resource/apps/mpxvideoplaybackcontrols.mif" - "!:/resource/apps/mpxvideoplaybackcontrols.mif" -;"../../../videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/conf/ui_videoplaybackcontrolstest.cfg" - "c:/testframework/ui_videoplaybackcontrolstest.cfg" -;"../../../videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/data/mmc/test.3gp" - "e:/testing/data/test.3gp" -;"../../../videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/data/mmc/test.rm" - "e:/testing/data/test.rm" - -; USERINPUTHANDLER -;"/epoc32/release/armv5/udeb/ui_userinputhandlertest.dll" - "c:/sys/bin/ui_userinputhandlertest.dll" -;"../../../videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/conf/ui_userinputhandlertest.cfg" - "c:/testframework/ui_userinputhandlertest.cfg" - - ; Embedded SIS ; None diff -r 3eb824b18d67 -r 375929f879c2 tsrc/testing/sis/fusion_unit_tests.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tsrc/testing/sis/fusion_unit_tests.pkg Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,103 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: Package file for fusion engine STIF tests; + +; Languages +&EN + +; Provide value for uid +#{"Fusion unit tests"},(0x00000000),1,1,0,TYPE=SA, RU + +; Series60 product id for S60 3.0 +[0x101F7961], 0, 0, 0, {"Series60ProductID"} + +; Localised Vendor name +%{"Nokia"} + +; Unique Vendor name +:"Nokia" + +; Logo +; None + +; Package signature - Optional +; None + +; Start of Package body + +; Condition blocks +; None + +; Options list +; None + +; Install files + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; VIDEOPLAYER UNIT TESTS + +; VIDEOHELIX +"/epoc32/release/armv5/udeb/videohelixtest.dll" - "!:/sys/bin/videohelixtest.dll" +"../../../videoplayback/videohelix/tsrc/ut_videohelixtest/conf/videohelixtest.cfg" - "c:/testframework/videohelixtest.cfg" +"../../../videoplayback/videohelix/tsrc/ut_videohelixtest/data/mmc/dcf.odf" - "e:/testing/data/dcf.odf" +"../../../videoplayback/videohelix/tsrc/ut_videohelixtest/data/mmc/sdp_test.sdp" - "e:/testing/data/sdp_test.sdp" +"../../../videoplayback/videohelix/tsrc/ut_videohelixtest/data/mmc/vhpp_test.3gp" - "e:/testing/data/vhpp_test.3gp" + +; MPXVIDEOPLAYER +"/epoc32/release/armv5/udeb/mpxvideoplayertest.dll" - "!:/sys/bin/mpxvideoplayertest.dll" +"../../../videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/conf/mpxvideoplayertest.cfg" - "c:/testframework/mpxvideoplayertest.cfg" + +"../../../videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/local.3gp" - "e:/testing/data/local.3gp" +"../../../videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/sdp_test.sdp" - "e:/testing/data/sdp_test.sdp" +"../../../videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_local_hw.ram" - "e:/testing/data/test_local.ram" +"../../../videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_multilocal_hw.ram" - "e:/testing/data/test_multilocal.ram" +"../../../videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_streaming.ram" - "e:/testing/data/test_streaming.ram" +"../../../videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_multilink_v2.asx" - "e:/testing/data/test_multilink_v2.asx" +"../../../videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/data/mmc/test_seekSingle_v3.asx" - "e:/testing/data/test_seekSingle_v3.asx" + +; VIDEOPLAYBACKCONTROLS +"/epoc32/release/armv5/udeb/ui_videoplaybackcontrolstest.dll" - "!:/sys/bin/ui_videoplaybackcontrolstest.dll" +"/epoc32/data/z/resource/apps/mpxvideoplaybackcontrols.rsc" - "!:/resource/apps/mpxvideoplaybackcontrols.rsc" +"/epoc32/data/z/resource/apps/mpxvideoplaybackcontrols.mif" - "!:/resource/apps/mpxvideoplaybackcontrols.mif" +"../../../videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/conf/ui_videoplaybackcontrolstest.cfg" - "c:/testframework/ui_videoplaybackcontrolstest.cfg" +"../../../videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/data/mmc/test.3gp" - "e:/testing/data/test.3gp" +"../../../videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/data/mmc/test.rm" - "e:/testing/data/test.rm" + +; USERINPUTHANDLER +"/epoc32/release/armv5/udeb/ui_userinputhandlertest.dll" - "c:/sys/bin/ui_userinputhandlertest.dll" +"../../../videoplayback/videoplaybackviews/tsrc/ut_userinputhandlertest/conf/ui_userinputhandlertest.cfg" - "c:/testframework/ui_userinputhandlertest.cfg" + +; VCXMYVIDEOSMDSDB +"/epoc32/release/armv5/udeb/VcxMyVideosMdsDbTest.dll" - "!:/Sys/Bin/VcxMyVideosMdsDbTest.dll" +"../../../videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/conf/VcxMyVideosMdsDbTest.cfg" - "c:/testframework/VcxMyVideosMdsDbTest.cfg" + +; VCXMYVIDEOSCOLLECTIONUTILTEST +"/epoc32/release/armv5/udeb/VcxMyVideosCollectionUtilTest.dll" - "!:/Sys/Bin/VcxMyVideosCollectionUtilTest.dll" +"../../../videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/data/mmc/file.txt" - "c:/data/vcxmyvideoscollectionutiltest_file.txt" +"../../../videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideoscollectionutiltest/conf/VcxMyVideosCollectionUtilTest.cfg" - "c:/testframework/VcxMyVideosCollectionUtilTest.cfg" + +; UT_COLLECTIONPLUGINTEST +"/epoc32/release/armv5/udeb/ut_collectionplugintest.dll" - "c:/sys/bin/ut_collectionplugintest.dll" +"../../../videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/conf/ut_collectionplugintest.cfg" - "c:/testframework/ut_collectionplugintest.cfg" + +; Embedded SIS +; None + +; End of Package body + +; PKG dependencies +; None + +; PKG capabilities +; None diff -r 3eb824b18d67 -r 375929f879c2 tsrc/testing/tools/builder.pl --- a/tsrc/testing/tools/builder.pl Wed Sep 15 12:15:24 2010 +0300 +++ b/tsrc/testing/tools/builder.pl Wed Oct 13 14:34:36 2010 +0300 @@ -45,7 +45,10 @@ "videoplayer\\videoplayback\\videoplaybackcontrols\\tsrc\\videoplaybackcontrols_test\\group", "videoplayer\\videoplayback\\videoplaybackviews\\tsrc\\ut_userinputhandlertest\\group", "videoplayer\\videoplayerapp\\mpxvideoplayer\\tsrc\\ut_mpxvideoplayertest\\group", - "videoplayer\\videocollection\\hgmyvideos\\tsrc\\ut_vcxhgmyvideosmainview\\group" + "videoplayer\\videocollection\\hgmyvideos\\tsrc\\ut_vcxhgmyvideosmainview\\group", + "videoplayer\\videocollection\\mpxmyvideoscollection\\tsrc\\ut_collectionplugintest\\group", + "videoplayer\\videocollection\\mpxmyvideoscollection\\tsrc\\ut_vcxmyvideoscollectionutiltest\\group", + "videoplayer\\videocollection\\mpxmyvideoscollection\\tsrc\\ut_vcxmyvideosmdsdb\\group" ); ######################################## diff -r 3eb824b18d67 -r 375929f879c2 tsrc/testing/tools/siscreator.pl --- a/tsrc/testing/tools/siscreator.pl Wed Sep 15 12:15:24 2010 +0300 +++ b/tsrc/testing/tools/siscreator.pl Wed Oct 13 14:34:36 2010 +0300 @@ -45,11 +45,15 @@ ); my @unitTests = ( + "videoplayer\\tsrc\\testing\\sis\\fusion_unit_tests.pkg", "videoplayer\\videoplayback\\videohelix\\tsrc\\ut_videohelixtest\\group\\videohelixtest.pkg", "videoplayer\\videoplayback\\videoplaybackcontrols\\tsrc\\videoplaybackcontrols_test\\group\\videoplaybackcontrolstest.pkg", "videoplayer\\videoplayback\\videoplaybackviews\\tsrc\\ut_userinputhandlertest\\group\\userinputhandlertest.pkg", "videoplayer\\videoplayerapp\\mpxvideoplayer\\tsrc\\ut_mpxvideoplayertest\\group\\mpxvideoplayertest.pkg", - "videoplayer\\videocollection\\hgmyvideos\\tsrc\\ut_vcxhgmyvideosmainview\\group\\VcxHgMyVideosMainViewTest.pkg" + "videoplayer\\videocollection\\hgmyvideos\\tsrc\\ut_vcxhgmyvideosmainview\\group\\VcxHgMyVideosMainViewTest.pkg", + "videoplayer\\videocollection\\mpxmyvideoscollection\\tsrc\\ut_collectionplugintest\\group\\ut_collectionplugintest.pkg", + "videoplayer\\videocollection\\mpxmyvideoscollection\\tsrc\\ut_vcxmyvideoscollectionutiltest\\group\\VcxMyVideosCollectionUtilTest.pkg", + "videoplayer\\videocollection\\mpxmyvideoscollection\\tsrc\\ut_vcxmyvideosmdsdb\\group\\VcxMyVideosMdsDbTest.pkg" ); ######################################## diff -r 3eb824b18d67 -r 375929f879c2 videocollection/hgmyvideos/inc/vcxhgmyvideoscategorymodelhandler.h --- a/videocollection/hgmyvideos/inc/vcxhgmyvideoscategorymodelhandler.h Wed Sep 15 12:15:24 2010 +0300 +++ b/videocollection/hgmyvideos/inc/vcxhgmyvideoscategorymodelhandler.h Wed Oct 13 14:34:36 2010 +0300 @@ -271,7 +271,7 @@ * Goes through given number of categories and * fills iCategoryIdArray from the accepted ones */ - void MakeCategoryIdArrayL(); + void MakeCategoryIdArray(); /** * Checks if the given category is accepted or not. @@ -351,24 +351,6 @@ * @return ETrue if the preloaded does exist, otherwise EFalse */ TBool PreloadedExistsL(); - - /** - * Check if given application exists. - * - * @param aAppUid Application UID - * @return ETrue if application exists in the system, EFalse otherwise. - */ - TBool AppExistsL( const TUid& aAppUid ); - - /** - * Check if extra item applications 2 and 3 exists in the system. - */ - void CheckIfExtraItemsExistsL(); - - /** - * 2nd phase constructor. - */ - void ConstructL(); private: @@ -412,16 +394,6 @@ * Video indicator class instance. Own. */ CMyVideosIndicator* iVideoIndicator; - - /** - * ETrue if extra item 2 exists, i.e. URL available or valid application UID. - */ - TBool iExtraItem2Exists; - - /** - * ETrue if extra item 3 exists, i.e. URL available or valid application UID. - */ - TBool iExtraItem3Exists; }; #endif // VCXHGMYVIDEOSCATEGORYMODELHANDLER_H diff -r 3eb824b18d67 -r 375929f879c2 videocollection/hgmyvideos/inc/vcxhgmyvideoscollectionclient.h --- a/videocollection/hgmyvideos/inc/vcxhgmyvideoscollectionclient.h Wed Sep 15 12:15:24 2010 +0300 +++ b/videocollection/hgmyvideos/inc/vcxhgmyvideoscollectionclient.h Wed Oct 13 14:34:36 2010 +0300 @@ -343,13 +343,6 @@ * @param aError system error code. */ void HandleGetVideoDetailsRespL( CMPXMessage* aMessage, TInt aError ); - - /** - * Gets current collection path category level index - * - * @return Index or KErrNotFound, if current path is not in video level - */ - TInt CategoryIndexL(); protected: diff -r 3eb824b18d67 -r 375929f879c2 videocollection/hgmyvideos/inc/vcxhgmyvideosthumbnailmanager.h --- a/videocollection/hgmyvideos/inc/vcxhgmyvideosthumbnailmanager.h Wed Sep 15 12:15:24 2010 +0300 +++ b/videocollection/hgmyvideos/inc/vcxhgmyvideosthumbnailmanager.h Wed Oct 13 14:34:36 2010 +0300 @@ -98,13 +98,6 @@ * @param aRequestId */ void Cancel( TThumbnailRequestId aRequestId ); - - /** - * Reset the generated thumbnails from given source - * - * aSource Thumbnail source - */ - void Reset( CThumbnailObjectSource& aSource ); /** * Adds observer. diff -r 3eb824b18d67 -r 375929f879c2 videocollection/hgmyvideos/inc/vcxhgmyvideosvideomodelhandler.h --- a/videocollection/hgmyvideos/inc/vcxhgmyvideosvideomodelhandler.h Wed Sep 15 12:15:24 2010 +0300 +++ b/videocollection/hgmyvideos/inc/vcxhgmyvideosvideomodelhandler.h Wed Oct 13 14:34:36 2010 +0300 @@ -458,16 +458,6 @@ * This method resets iMarkedMediaList before returning. */ void RestoreMarkingsL(); - - /** - * Resets the empty thumbnail from DRM protected video clip. - * This causes the thumbnail to be attempted to be regenerated - * next time the thumbnail is fetched fron thumbnail manager. - * - * @param aMedia Media from which new video tag will be cleared. - * @param aIndex Index of the visible item. - */ - void ResetEmptyDrmThumnailL( CMPXMedia& aMedia, TInt aIndex ); private: diff -r 3eb824b18d67 -r 375929f879c2 videocollection/hgmyvideos/src/vcxhgmyvideoscategorymodelhandler.cpp --- a/videocollection/hgmyvideos/src/vcxhgmyvideoscategorymodelhandler.cpp Wed Sep 15 12:15:24 2010 +0300 +++ b/videocollection/hgmyvideos/src/vcxhgmyvideoscategorymodelhandler.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -39,7 +39,6 @@ #include #include #include -#include #include #include @@ -69,9 +68,7 @@ { CVcxHgMyVideosCategoryModelHandler* self = new (ELeave) CVcxHgMyVideosCategoryModelHandler( aModel, aScroller ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); + return self; } @@ -90,62 +87,6 @@ } // ----------------------------------------------------------------------------- -// CVcxHgMyVideosCategoryModelHandler::ConstructL() -// ----------------------------------------------------------------------------- -// -void CVcxHgMyVideosCategoryModelHandler::ConstructL() - { - CheckIfExtraItemsExistsL(); - } - -// ----------------------------------------------------------------------------- -// CVcxHgMyVideosCategoryModelHandler::CheckIfExtraItemsExistsL() -// ----------------------------------------------------------------------------- -// -void CVcxHgMyVideosCategoryModelHandler::CheckIfExtraItemsExistsL() - { - TInt value = 0; - TBuf url; - // Check that cenrep exists and has some valid data - iModel.GetMyVideosCustomizationString( KCRVideoPlayerExtraItem2Url, url ); // ignore error code - if ( url.Length() == 0 ) - { - TInt err = iModel.GetMyVideosCustomizationInt( KCRVideoPlayerExtraItem2Uid, value ); - if ( err == KErrNone && value != 0 ) - { - if ( AppExistsL( TUid::Uid( value ) ) ) - { - iExtraItem2Exists = ETrue; - } - } - } - else - { - iExtraItem2Exists = ETrue; - } - - value = 0; - url.Zero(); - iModel.GetMyVideosCustomizationString( KCRVideoPlayerExtraItem3Url, url ); // ignore error code - if ( url.Length() == 0 ) - { - TInt err = iModel.GetMyVideosCustomizationInt( KCRVideoPlayerExtraItem3Uid, value ); - if ( err == KErrNone && value != 0 ) - { - if ( AppExistsL( TUid::Uid( value ) ) ) - { - iExtraItem3Exists = ETrue; - } - } - } - else - { - iExtraItem3Exists = ETrue; - } - - } - -// ----------------------------------------------------------------------------- // CVcxHgMyVideosCategoryModelHandler::~CVcxHgMyVideosCategoryModelHandler() // ----------------------------------------------------------------------------- // @@ -727,7 +668,7 @@ { IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # UpdateCategoryListL() - Enter" ); - MakeCategoryIdArrayL(); + MakeCategoryIdArray(); if ( iCategoryIdArray.Count() != iScroller.ItemCount() ) { @@ -817,12 +758,12 @@ } // ----------------------------------------------------------------------------- -// CVcxHgMyVideosCategoryModelHandler::MakeCategoryIdArrayL() +// CVcxHgMyVideosCategoryModelHandler::MakeCategoryIdArray() // ----------------------------------------------------------------------------- // -void CVcxHgMyVideosCategoryModelHandler::MakeCategoryIdArrayL() +void CVcxHgMyVideosCategoryModelHandler::MakeCategoryIdArray() { - IPTVLOGSTRING_LOW_LEVEL("CVcxHgMyVideosCategoryModelHandler::MakeCategoryIdArrayL"); + IPTVLOGSTRING_LOW_LEVEL("CVcxHgMyVideosCategoryModelHandler::MakeCategoryIdArray"); iCategoryIdArray.Reset(); @@ -835,7 +776,7 @@ if ( error == KErrNone && value > EMyVideosListItemTypeEmpty ) { - IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # MakeCategoryIdArrayL() Getting category items from cenrep" ); + IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # MakeCategoryIdArray() Getting category items from cenrep" ); for ( TInt i=KCRVideoPlayerItemLocation1; i<=KCRVideoPlayerItemLocation7; i++ ) { @@ -872,17 +813,17 @@ if ( AcceptCategory( categoryId ) ) { - iCategoryIdArray.AppendL( categoryId ); + iCategoryIdArray.Append( categoryId ); } } } } else { - iCategoryIdArray.AppendL( KCategoryIdLastWatched ); - iCategoryIdArray.AppendL( KVcxMvcCategoryIdCaptured ); - iCategoryIdArray.AppendL( KVcxMvcCategoryIdOther ); - iCategoryIdArray.AppendL( KCategoryIdExtraItem1 ); + iCategoryIdArray.Append( KCategoryIdLastWatched ); + iCategoryIdArray.Append( KVcxMvcCategoryIdCaptured ); + iCategoryIdArray.Append( KVcxMvcCategoryIdOther ); + iCategoryIdArray.Append( KCategoryIdExtraItem1 ); } } @@ -900,20 +841,12 @@ case KVcxMvcCategoryIdOther: case KCategoryIdLastWatched: case KCategoryIdExtraItem1: + case KCategoryIdExtraItem2: + case KCategoryIdExtraItem3: IPTVLOGSTRING2_LOW_LEVEL( "MPX My Videos UI # AcceptCategory() Accepted category: %d", aCategoryId ); ret = ETrue; break; - case KCategoryIdExtraItem2: - ret = iExtraItem2Exists; - IPTVLOGSTRING2_LOW_LEVEL( - "MPX My Videos UI # AcceptCategory() extra item 2 accepted: %d", ret ); - break; - case KCategoryIdExtraItem3: - ret = iExtraItem3Exists; - IPTVLOGSTRING2_LOW_LEVEL( - "MPX My Videos UI # AcceptCategory() extra item 3 accepted: %d", ret ); - break; default: IPTVLOGSTRING2_LOW_LEVEL( "MPX My Videos UI # AcceptCategory() Unknown category: %d", aCategoryId ); @@ -1315,26 +1248,3 @@ return EFalse; } } - -// ------------------------------------------------------------------------------ -// CVcxHgMyVideosVideoModelHandler::AppExistsL() -// ------------------------------------------------------------------------------ -// -TBool CVcxHgMyVideosCategoryModelHandler::AppExistsL( const TUid& aAppUid ) - { - IPTVLOGSTRING_LOW_LEVEL( "CVcxHgMyVideosCategoryModelHandler::AppExistsL()" ); - TBool retVal( EFalse ); - RApaLsSession appArcSession; - User::LeaveIfError( appArcSession.Connect() ); - CleanupClosePushL( appArcSession ); - - TApaAppInfo appInfo; - TInt err = appArcSession.GetAppInfo( appInfo, aAppUid ); - if ( err == KErrNone ) - { - IPTVLOGSTRING_LOW_LEVEL( "CVcxHgMyVideosCategoryModelHandler::AppExistsL(): return TRUE" ); - retVal = ETrue; - } - CleanupStack::PopAndDestroy( &appArcSession ); - return retVal; - } diff -r 3eb824b18d67 -r 375929f879c2 videocollection/hgmyvideos/src/vcxhgmyvideoscollectionclient.cpp --- a/videocollection/hgmyvideos/src/vcxhgmyvideoscollectionclient.cpp Wed Sep 15 12:15:24 2010 +0300 +++ b/videocollection/hgmyvideos/src/vcxhgmyvideoscollectionclient.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -47,7 +47,6 @@ const TInt KVcxHgEventLevelCategory = 2; const TInt KVcxHgEventLevelVideo = 3; -const TInt KVcxMpxLevelRoot = 1; const TInt KVcxMpxLevelCategories = 2; const TInt KVcxMpxLevelVideos = 3; @@ -221,20 +220,9 @@ } else if ( iCollectionLevel == KVcxMpxLevelVideos ) { - TInt currentIndex = CategoryIndexL(); - - if ( aIndex == currentIndex ) - { - // OpenL() will return a list if there has been any changes. - // No reply if list is same as with previous OpenL(). - iCollectionUtility->Collection().OpenL(); - } - else - { - iCollectionUtility->Collection().BackL( ); - iCollectionUtility->Collection().OpenL( aIndex ); - iCollectionLevel = KErrNotFound; - } + // OpenL() will return a list if there has been any changes. + // No reply if list is same as with previous OpenL(). + iCollectionUtility->Collection().OpenL(); } else { @@ -393,30 +381,16 @@ IPTVLOGSTRING2_LOW_LEVEL( "CVcxHgMyVideosCollectionClient::PlayVideoL: Play video at collection index %d", aMpxItemId.iId1 ); - CMPXCollectionPath* collectionPath = iCollectionUtility->Collection().PathL(); - CleanupStack::PushL( collectionPath ); + CMPXCollectionPath* path = CMPXCollectionPath::NewL(); + CleanupStack::PushL(path); - if ( collectionPath->Levels() == KVcxMpxLevelVideos ) - { - collectionPath->DeselectAll(); - collectionPath->SelectL( aMpxItemId ); - iCollectionUtility->Collection().OpenL( *collectionPath ); - } - else - { - CMPXCollectionPath* customPath = CMPXCollectionPath::NewL(); - CleanupStack::PushL(customPath); - - customPath->AppendL( KVcxUidMyVideosMpxCollection ); - customPath->AppendL( KVcxMvcCategoryIdAll ); - customPath->AppendL( aMpxItemId ); - customPath->SelectL( aMpxItemId ); - - iCollectionUtility->Collection().OpenL( *customPath ); - CleanupStack::PopAndDestroy( customPath ); - } - - CleanupStack::PopAndDestroy( collectionPath ); + path->AppendL( KVcxUidMyVideosMpxCollection ); + path->AppendL( KVcxMvcCategoryIdAll ); + path->AppendL( aMpxItemId ); + path->SelectL( aMpxItemId ); + + iCollectionUtility->Collection().OpenL( *path ); + CleanupStack::PopAndDestroy(path); } // ----------------------------------------------------------------------------- @@ -1166,24 +1140,6 @@ } } -// ----------------------------------------------------------------------------- -// CVcxHgMyVideosCollectionClient::CategoryIndexL() -// ----------------------------------------------------------------------------- -// -TInt CVcxHgMyVideosCollectionClient::CategoryIndexL() - { - CMPXCollectionPath* path = iCollectionUtility->Collection().PathL(); - CleanupStack::PushL( path ); - TInt index ( -1 ); - if ( path->Levels() > KVcxMpxLevelCategories ) - { - index = path->Index( KVcxMpxLevelRoot ); - } - CleanupStack::PopAndDestroy( path ); - - return index; - } - #if defined(_DEBUG) && IPTV_LOGGING_METHOD != 0 // ----------------------------------------------------------------------------- // CVcxHgMyVideosCollectionClient::DebugPrintVideoListL() diff -r 3eb824b18d67 -r 375929f879c2 videocollection/hgmyvideos/src/vcxhgmyvideosthumbnailmanager.cpp --- a/videocollection/hgmyvideos/src/vcxhgmyvideosthumbnailmanager.cpp Wed Sep 15 12:15:24 2010 +0300 +++ b/videocollection/hgmyvideos/src/vcxhgmyvideosthumbnailmanager.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -114,18 +114,6 @@ } // ----------------------------------------------------------------------------- -// CVcxHgMyVideosThumbnailManager::Reset() -// ----------------------------------------------------------------------------- -// -void CVcxHgMyVideosThumbnailManager::Reset( CThumbnailObjectSource& aSource ) - { - if ( iTnManager ) - { - iTnManager->DeleteThumbnails( aSource ); - } - } - -// ----------------------------------------------------------------------------- // CVcxHgMyVideosThumbnailManager::AddObserverL() // ----------------------------------------------------------------------------- // diff -r 3eb824b18d67 -r 375929f879c2 videocollection/hgmyvideos/src/vcxhgmyvideosvideodataupdater.cpp --- a/videocollection/hgmyvideos/src/vcxhgmyvideosvideodataupdater.cpp Wed Sep 15 12:15:24 2010 +0300 +++ b/videocollection/hgmyvideos/src/vcxhgmyvideosvideodataupdater.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -113,7 +113,8 @@ iModel( aModel ), iScroller( aScroller ), iVideoArray( aVideoArray ), - iVideosIndicator( aVideosIndicator ) + iVideosIndicator( aVideosIndicator ), + iPaused( EFalse ) { CActiveScheduler::Add( this ); } diff -r 3eb824b18d67 -r 375929f879c2 videocollection/hgmyvideos/src/vcxhgmyvideosvideomodelhandler.cpp --- a/videocollection/hgmyvideos/src/vcxhgmyvideosvideomodelhandler.cpp Wed Sep 15 12:15:24 2010 +0300 +++ b/videocollection/hgmyvideos/src/vcxhgmyvideosvideomodelhandler.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -41,7 +41,6 @@ #include "vcxhgmyvideosvideomodelhandler.h" #include "vcxhgmyvideosvideolistimpl.h" #include "vcxhgmyvideosvideodataupdater.h" -#include "vcxhgmyvideosthumbnailmanager.h" #include "vcxhgmyvideos.hrh" #include "vcxhgmyvideoslistbase.h" @@ -604,7 +603,6 @@ TMPXItemId mpxItemId = media->ValueTObjectL( KMPXMediaGeneralId ); SetVideoLastWatchedL( *media ); ClearNewVideoFlagL( *media ); - ResetEmptyDrmThumnailL( *media, aIndex ); IPTVLOGSTRING3_LOW_LEVEL( "CVcxHgMyVideosVideoModelHandler::PlayVideoL() aIndex=%d mpxItemId=%d", aIndex, (TInt) mpxItemId ); iModel.CollectionClient().PlayVideoL( mpxItemId ); } @@ -1419,29 +1417,3 @@ aMedia.ValueTObjectL( KMPXMediaGeneralId ), flags ); } } - -// ----------------------------------------------------------------------------- -// CVcxHgMyVideosVideoModelHandler::ResetEmptyDrmThumnailL() -// ----------------------------------------------------------------------------- -// -void CVcxHgMyVideosVideoModelHandler::ResetEmptyDrmThumnailL( CMPXMedia& aMedia, TInt aIndex ) - { - CHgItem& item = iScroller.ItemL( aIndex ); - - if ( !item.Icon() ) - { - if ( aMedia.IsSupported( KMPXMediaGeneralFlags ) && - aMedia.ValueTObjectL( KMPXMediaGeneralFlags ) - == EVcxMyVideosVideoDrmProtected ); - { - CThumbnailObjectSource* source = - CThumbnailObjectSource::NewLC( aMedia.ValueText( KMPXMediaGeneralUri ), NULL ); - - // We cannot know at this phase, do the user get the license - // when playing the video, so we have to reset this every time. - iModel.ThumbnailManager().Reset( *source ); - - CleanupStack::PopAndDestroy( source ); - } - } - } diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/inc/vcxmyvideoscategories.h --- a/videocollection/mpxmyvideoscollection/inc/vcxmyvideoscategories.h Wed Sep 15 12:15:24 2010 +0300 +++ b/videocollection/mpxmyvideoscollection/inc/vcxmyvideoscategories.h Wed Oct 13 14:34:36 2010 +0300 @@ -216,12 +216,9 @@ * calling function already has it available. * @param aVideosIncrements How many new items were added to each category. * @param aNewVideosIncrements How many videos with new flag were added to each category. - * @param aForceUpdate If set, the modify event is raised even though the count - * has not changed. ETrue, if update is to be forced. */ void UpdateVideosCountL( CMPXMediaArray& aCategoryArray, - RArray& aVideosIncrements, RArray& aNewVideosIncrements, - TBool aForceUpdate ); + RArray& aVideosIncrements, RArray& aNewVideosIncrements ); /** * Increases/decreases aCountAttribute in aCategory. Adds event to diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp Wed Sep 15 12:15:24 2010 +0300 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosasyncfileoperations.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -602,20 +602,9 @@ if ( iIsMoveOperation ) { MPX_DEBUG2("CVcxMyVideosAsyncFileOperations:: move operation failed %d", aErr ); - - if ( ! BaflUtils::FileExists( iCollection.iFs, iSourcePath ) ) - { - MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: mmc removed, deleting the old media" ); - iCollection.iMyVideosMdsDb->RemoveVideo( iMediaForMoveOp->ValueTObjectL( - KMPXMediaGeneralId ).iId1 ); - } - else - { - MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: setting media path back in MDS" ); - iMediaForMoveOp->SetTextValueL( KMPXMediaGeneralUri, iSourcePath ); - iCollection.SetVideoL( *iMediaForMoveOp ); - } - + MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: setting media path back in MDS" ); + iMediaForMoveOp->SetTextValueL( KMPXMediaGeneralUri, iSourcePath ); + iCollection.SetVideoL( *iMediaForMoveOp ); MPX_DEBUG1("CVcxMyVideosAsyncFileOperations:: deleting target file"); TInt delErr = BaflUtils::DeleteFile( iCollection.iFs, iTargetPath ); if ( delErr != KErrNone ) diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/src/vcxmyvideoscategories.cpp --- a/videocollection/mpxmyvideoscollection/src/vcxmyvideoscategories.cpp Wed Sep 15 12:15:24 2010 +0300 +++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideoscategories.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -256,8 +256,7 @@ } // Update videos counts - UpdateVideosCountL( *categoryArray, videosIncrements, - newVideosIncrements, !aNewItemsStartIndex ); + UpdateVideosCountL( *categoryArray, videosIncrements, newVideosIncrements ); CleanupStack::PopAndDestroy( &newVideosIncrements ); // <-1 CleanupStack::PopAndDestroy( &videosIncrements ); // <-1 @@ -268,8 +267,7 @@ // ---------------------------------------------------------------------------- // void CVcxMyVideosCategories::UpdateVideosCountL( CMPXMediaArray& aCategoryArray, - RArray& aVideosIncrements, RArray& aNewVideosIncrements, - TBool aForceUpdate ) + RArray& aVideosIncrements, RArray& aNewVideosIncrements ) { TBool modified = EFalse; TInt categoryCount = aCategoryArray.Count(); @@ -277,7 +275,7 @@ for ( TInt i = 0; i < categoryCount; i++ ) { - if ( aForceUpdate || aVideosIncrements[i] != 0 ) + if ( aVideosIncrements[i] != 0 ) { category = aCategoryArray.AtL( i ); @@ -289,7 +287,7 @@ } //codescanner warning: aNewVideosIncrements count is same as aCategoryArray count, so the range is checked - if ( aForceUpdate || aNewVideosIncrements[i] != 0 ) + if ( aNewVideosIncrements[i] != 0 ) { category = aCategoryArray.AtL( i ); @@ -316,9 +314,10 @@ if ( aIncrement != 0 ) { AddToTUint32AttributeL( aCategory, aIncrement, aCountAttribute ); + + iCollection.iMessageList->AddEventL( aCategory.ValueTObjectL( + KMPXMediaGeneralId ), EMPXItemModified, aEventInfo ); } - iCollection.iMessageList->AddEventL( aCategory.ValueTObjectL( - KMPXMediaGeneralId ), EMPXItemModified, aEventInfo ); } // ---------------------------------------------------------------------------- diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/bwins/ut_collectionplugintestu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/bwins/ut_collectionplugintestu.def Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,3 @@ +EXPORTS + ?LibEntryL@@YAPAVCScriptBase@@AAVCTestModuleIf@@@Z @ 1 NONAME ; class CScriptBase * LibEntryL(class CTestModuleIf &) + diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/conf/ut_collectionplugintest.cfg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/conf/ut_collectionplugintest.cfg Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,808 @@ +[Define] +CollectionIdMyVideos "0" + +// STUBS +EActiveTask 1 +EAlbums 2 +EAsyncFileOperations 3 +ECategories 4 +EMDSDB 5 +EMessageList 6 +EOpenHandler 7 +EVideoCache 8 + +KInvalidId -100 + +KSelectAll -2 + +SYNC 1 +ASYNC 0 + +KVcxCommandMyVideosStartDownload 0 // obsolete? +KVcxCommandMyVideosCancelDownload 1 // obsolete? +KVcxCommandMyVideosResumeDownload 2 // obsolete? +KVcxCommandMyVideosPauseDownload 3 // obsolete? +KVcxCommandMyVideosGetMediaFullDetailsByMpxId 4 // async +KVcxCommandMyVideosGetMediasByMpxId 5 // async +KVcxCommandMyVideosMove 6 // async +KVcxCommandMyVideosCopy 7 // async +KVcxCommandMyVideosDelete 8 // async +KVcxCommandMyVideosAddToAlbum 9 // async +KVcxCommandMyVideosRemoveFromAlbum 10 // async +KVcxCommandMyVideosAddAlbum 11 // async & sync +KVcxCommandMyVideosRemoveAlbums 12 // async +KVcxCommandMyVideosCancelMoveOrCopy 13 // sync +KVcxCommandMyVideosCancelDelete 14 // sync +KVcxMessageMyVideosGetMediasByMpxIdResp 15 // async +KVcxMessageMyVideosItemsAppended 16 // event +KVcxMessageMyVideosListComplete 17 // event +KVcxMessageMyVideosMoveOrCopyStarted 18 // event +KVcxMessageMyVideosDeleteStarted 19 // event +KVcxMessageMyVideosMoveResp 20 // event +KVcxMessageMyVideosCopyResp 21 // event +KVcxMessageMyVideosDeleteResp 22 // event +KVcxMessageMyVideosMessageArray 23 + +KVcxCommandIdMyVideos "20016BA0" +KMPXCommandIdCollectionSet "10282963" +KMPXCommandIdCollectionRemoveMedia "10282949" +KMPXCommandIdCollectionAdd "10282962" + +EMPXItemDeleted 1 +EMPXItemInserted 2 +EMPXItemModified 3 + +// special variables used with vcxmyvideoscache_stub +KMPXIdLeave 999 +KMPXIdNotFound 998 +KMPXIdChanged 997 + +EMediaTypeVideo 0 +EMediaTypeCategory 1 +EMediaTypeAlbum 2 + +EMediaGeneralId 1 +EMediaGeneralTitle 2 + +[Enddefine] + +[Test] +title OpenL CollectionIdMyVideos +create ut_collectionplugintest CPTest +CPTest OpenL CollectionIdMyVideos +delete CPTest +[Endtest] + +[Test] +title MediaL no medias +create ut_collectionplugintest CPTest +CPTest OpenL CollectionIdMyVideos +CPTest InsertToPath 1 EMediaTypeVideo +CPTest InsertToPath 2 EMediaTypeVideo +CPTest SelectPath 1 +CPTest SelectAttributes EMediaGeneralId +CPTest MediaL +delete CPTest +[Endtest] + +[Test] +title MediaL select one, video in cache +create ut_collectionplugintest CPTest +CPTest OpenL CollectionIdMyVideos +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 1 EMediaTypeVideo +CPTest AddMediaToCache +CPTest SetMediaAttribute EMediaGeneralId 2 EMediaTypeVideo +CPTest AddMediaToCache +CPTest InsertToPath 1 EMediaTypeVideo +CPTest InsertToPath 2 EMediaTypeVideo +CPTest SelectPath 1 +CPTest SelectAttributes EMediaGeneralId +CPTest MediaL +delete CPTest +[Endtest] + +[Test] +title MediaL select one, video not in cache +create ut_collectionplugintest CPTest +CPTest OpenL CollectionIdMyVideos +CPTest InsertToPath KMPXIdNotFound EMediaTypeVideo +CPTest SelectPathId KMPXIdNotFound +CPTest SelectAttributes EMediaGeneralId +CPTest MediaL +delete CPTest +[Endtest] + +[Test] +title MediaL select one, all attributes +create ut_collectionplugintest CPTest +CPTest OpenL CollectionIdMyVideos +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 1 EMediaTypeVideo +CPTest AddMediaToCache +CPTest SetMediaAttribute EMediaGeneralId 2 EMediaTypeVideo +CPTest AddMediaToCache +CPTest InsertToPath 1 EMediaTypeVideo +CPTest InsertToPath 2 EMediaTypeVideo +CPTest SelectPath 1 +CPTest SelectAttributes -1 +CPTest MediaL +delete CPTest +[Endtest] + +[Test] +title MediaL select one, no video in mds +create ut_collectionplugintest CPTest +CPTest OpenL CollectionIdMyVideos +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId KMPXIdNotFound EMediaTypeVideo +CPTest AddMediaToCache +CPTest InsertToPath KMPXIdNotFound EMediaTypeVideo +CPTest SelectPathId KMPXIdNotFound +CPTest SelectAttributes -1 +CPTest MediaL +delete CPTest +[Endtest] + +[Test] +title MediaL select none +create ut_collectionplugintest CPTest +CPTest OpenL CollectionIdMyVideos +CPTest SelectPath -1 +CPTest SelectAttributes EMediaGeneralId +CPTest MediaL +delete CPTest +[Endtest] + +[Test] +title MediaL select all +create ut_collectionplugintest CPTest +CPTest OpenL CollectionIdMyVideos +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 1 EMediaTypeVideo +CPTest AddMediaToCache +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 2 EMediaTypeVideo +CPTest AddMediaToCache +CPTest InsertToPath 1 EMediaTypeVideo +CPTest InsertToPath 2 EMediaTypeVideo +CPTest SelectPath KSelectAll +CPTest SelectAttributes EMediaGeneralId +CPTest MediaL +delete CPTest +[Endtest] + +[Test] +title MediaL select all, all attributes +create ut_collectionplugintest CPTest +CPTest OpenL CollectionIdMyVideos +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 1 EMediaTypeVideo +CPTest AddMediaToCache +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 2 EMediaTypeVideo +CPTest AddMediaToCache +CPTest InsertToPath 1 EMediaTypeVideo +CPTest InsertToPath 2 EMediaTypeVideo +CPTest SelectPath KSelectAll +CPTest SelectAttributes -1 +CPTest MediaL +delete CPTest +[Endtest] + +[Test] +title CancelRequest +create ut_collectionplugintest CPTest +CPTest CancelRequest +delete CPTest +[Endtest] + +[Test] +title CommandL no cmd +create ut_collectionplugintest CPTest +allownextresult -6 +CPTest CommandL SYNC +delete CPTest +[Endtest] + +[Test] +title CommandL invalid cmd +create ut_collectionplugintest CPTest +allownextresult -5 +CPTest CommandL SYNC "000001" +delete CPTest +[Endtest] + +[Test] +title CommandL no sync value +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 0 EMediaTypeVideo +CPTest CommandL -1 KMPXCommandIdCollectionAdd +delete CPTest +[Endtest] + +[Test] +title CommandL mv cmd, not supported +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 1 EMediaTypeVideo +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosGetMediaFullDetailsByMpxId +CPTest CheckCurrentCmd KVcxCommandIdMyVideos KVcxCommandMyVideosGetMediaFullDetailsByMpxId +CPTest CreateNewCmd ASYNC KVcxCommandIdMyVideos -1 +CPTest SetNewCmd +allownextresult -6 +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL get full details +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 1 EMediaTypeVideo +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosGetMediaFullDetailsByMpxId +CPTest CheckCurrentCmd KVcxCommandIdMyVideos KVcxCommandMyVideosGetMediaFullDetailsByMpxId +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL get full details, no id +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 0 EMediaTypeVideo +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosGetMediaFullDetailsByMpxId +CPTest CheckCurrentCmd KVcxCommandIdMyVideos KVcxCommandMyVideosGetMediaFullDetailsByMpxId +allownextresult -6 +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL get full details, no video found +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId KInvalidId EMediaTypeVideo +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosGetMediaFullDetailsByMpxId +CPTest CheckCurrentCmd KVcxCommandIdMyVideos KVcxCommandMyVideosGetMediaFullDetailsByMpxId +allownextresult -1 +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL get medias +create ut_collectionplugintest CPTest +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosGetMediasByMpxId 1 2 3 +CPTest CheckCurrentCmd KVcxCommandIdMyVideos KVcxCommandMyVideosGetMediasByMpxId +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL get medias, no ids +create ut_collectionplugintest CPTest +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosGetMediasByMpxId -1 +CPTest CheckCurrentCmd KVcxCommandIdMyVideos KVcxCommandMyVideosGetMediasByMpxId +allownextresult -6 +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL move +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 0 EMediaTypeVideo +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosMove +CPTest CheckCurrentCmd KVcxCommandIdMyVideos KVcxCommandMyVideosMove +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL move, asyncfileoperations deleted +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 0 EMediaTypeVideo +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosMove +CPTest CheckCurrentCmd KVcxCommandIdMyVideos KVcxCommandMyVideosMove +CPTest DeleteStub EAsyncFileOperations +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL copy +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 0 EMediaTypeVideo +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosCopy +CPTest CheckCurrentCmd KVcxCommandIdMyVideos KVcxCommandMyVideosCopy +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL copy, asyncfileoperations deleted +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 0 EMediaTypeVideo +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosCopy +CPTest CheckCurrentCmd KVcxCommandIdMyVideos KVcxCommandMyVideosCopy +CPTest DeleteStub EAsyncFileOperations +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL delete +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 0 EMediaTypeVideo +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosDelete +CPTest CheckCurrentCmd KVcxCommandIdMyVideos KVcxCommandMyVideosDelete +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL delete, asyncfileoperations deleted +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 0 EMediaTypeVideo +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosDelete +CPTest CheckCurrentCmd KVcxCommandIdMyVideos KVcxCommandMyVideosDelete +CPTest DeleteStub EAsyncFileOperations +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL add album sync +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 0 EMediaTypeAlbum +CPTest SetMediaAttribute EMediaGeneralTitle "Album1" +CPTest CommandL SYNC KVcxCommandIdMyVideos KVcxCommandMyVideosAddAlbum +delete CPTest +[Endtest] + +[Test] +title CommandL add album async +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 0 EMediaTypeAlbum +CPTest SetMediaAttribute EMediaGeneralTitle "Album1" +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosAddAlbum +CPTest CheckCurrentCmd KVcxCommandIdMyVideos KVcxCommandMyVideosAddAlbum +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL add album sync, albums deleted +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 0 EMediaTypeAlbum +CPTest SetMediaAttribute EMediaGeneralTitle "Album1" +CPTest DeleteStub EAlbums +CPTest CommandL SYNC KVcxCommandIdMyVideos KVcxCommandMyVideosAddAlbum +delete CPTest +[Endtest] + +[Test] +title CommandL add album async, albums deleted +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 0 EMediaTypeAlbum +CPTest SetMediaAttribute EMediaGeneralTitle "Album1" +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosAddAlbum +CPTest CheckCurrentCmd KVcxCommandIdMyVideos KVcxCommandMyVideosAddAlbum +CPTest DeleteStub EAlbums +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL remove albums +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 0 EMediaTypeAlbum +CPTest SetMediaAttribute EMediaGeneralTitle "Album1" +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosRemoveAlbums +CPTest CheckCurrentCmd KVcxCommandIdMyVideos KVcxCommandMyVideosRemoveAlbums +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL add to album +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 0 EMediaTypeAlbum +CPTest SetMediaAttribute EMediaGeneralTitle "Album1" +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosAddToAlbum +CPTest CheckCurrentCmd KVcxCommandIdMyVideos KVcxCommandMyVideosAddToAlbum +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL remove from album +create ut_collectionplugintest CPTest +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosRemoveFromAlbum +CPTest CheckCurrentCmd KVcxCommandIdMyVideos KVcxCommandMyVideosRemoveFromAlbum +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL cancel move or copy SYNC +create ut_collectionplugintest CPTest +CPTest CommandL SYNC KVcxCommandIdMyVideos KVcxCommandMyVideosCancelMoveOrCopy +CPTest CheckCurrentCmd -1 +delete CPTest +[Endtest] + +[Test] +title CommandL cancel move or copy ASYNC +create ut_collectionplugintest CPTest +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosCancelMoveOrCopy +CPTest CheckCurrentCmd KVcxCommandIdMyVideos KVcxCommandMyVideosCancelMoveOrCopy +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL cancel delete SYNC +create ut_collectionplugintest CPTest +CPTest CommandL SYNC KVcxCommandIdMyVideos KVcxCommandMyVideosCancelDelete +CPTest CheckCurrentCmd -1 +delete CPTest +[Endtest] + +[Test] +title CommandL cancel delete ASYNC +create ut_collectionplugintest CPTest +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosCancelDelete +CPTest CheckCurrentCmd KVcxCommandIdMyVideos KVcxCommandMyVideosCancelDelete +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL remove media +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 1 EMediaTypeVideo +CPTest CommandL ASYNC KMPXCommandIdCollectionRemoveMedia +CPTest CheckCurrentCmd KMPXCommandIdCollectionRemoveMedia +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL KMPXCommandIdCollectionAdd +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 0 EMediaTypeVideo +CPTest CommandL SYNC KMPXCommandIdCollectionAdd +delete CPTest +[Endtest] + +[Test] +title CommandL KMPXCommandIdCollectionSet video SYNC +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 0 EMediaTypeVideo +CPTest CommandL SYNC KMPXCommandIdCollectionSet +delete CPTest +[Endtest] + +[Test] +title CommandL KMPXCommandIdCollectionSet album SYNC +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 0 EMediaTypeAlbum +CPTest CommandL SYNC KMPXCommandIdCollectionSet +delete CPTest +[Endtest] + +[Test] +title CommandL KMPXCommandIdCollectionSet invalid SYNC +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 0 -1 +allownextresult -1 +CPTest CommandL SYNC KMPXCommandIdCollectionSet +delete CPTest +[Endtest] + +[Test] +title CommandL KMPXCommandIdCollectionSet video ASYNC +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 0 EMediaTypeVideo +CPTest CommandL ASYNC KMPXCommandIdCollectionSet +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL KMPXCommandIdCollectionSet album ASYNC +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 0 EMediaTypeAlbum +CPTest CommandL ASYNC KMPXCommandIdCollectionSet +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title CommandL KMPXCommandIdCollectionSet invalid ASYNC +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 0 -1 +CPTest CommandL ASYNC KMPXCommandIdCollectionSet +CPTest HandleStepL +delete CPTest +[Endtest] + +[Test] +title FindAllL +create ut_collectionplugintest CPTest +CPTest FindAllL +delete CPTest +[Endtest] + +[Test] +title FindAllSyncL +create ut_collectionplugintest CPTest +CPTest FindAllSyncL +delete CPTest +[Endtest] + +[Test] +title GetCapabilities +create ut_collectionplugintest CPTest +CPTest GetCapabilities +delete CPTest +[Endtest] + +[Test] +title AddL +create ut_collectionplugintest CPTest +CPTest AddL +delete CPTest +[Endtest] + +[Test] +title RemoveL +create ut_collectionplugintest CPTest +CPTest RemoveL +delete CPTest +[Endtest] + +[Test] +title SetL +create ut_collectionplugintest CPTest +CPTest SetL +delete CPTest +[Endtest] + +[Test] +title HandleOperationCompleted +create ut_collectionplugintest CPTest +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosMove +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosCopy +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosDelete +delete CPTest +[Endtest] + +[Test] +title HandleOperationCompleted asyncfileoperations deleted +create ut_collectionplugintest CPTest +CPTest DeleteStub EAsyncFileOperations +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosMove +CPTest DeleteStub EAsyncFileOperations +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosCopy +CPTest DeleteStub EAsyncFileOperations +CPTest CommandL ASYNC KVcxCommandIdMyVideos KVcxCommandMyVideosDelete +delete CPTest +[Endtest] + +[Test] +title HandleMyVideosDbEvent EMPXItemDeleted +create ut_collectionplugintest CPTest +CPTest HandleMyVideosDbEvent EMPXItemDeleted 0 1 +delete CPTest +[Endtest] + +[Test] +title HandleMyVideosDbEvent EMPXItemDeleted, categories deleted +create ut_collectionplugintest CPTest +CPTest DeleteStub ECategories +CPTest HandleMyVideosDbEvent EMPXItemDeleted 0 1 +delete CPTest +[Endtest] + +[Test] +title HandleMyVideosDbEvent EMPXItemDeleted messagelist leaves +create ut_collectionplugintest CPTest +CPTest SetVideoListFetching 0 +CPTest HandleMyVideosDbEvent EMPXItemDeleted KMPXIdLeave 2 +delete CPTest +[Endtest] + +[Test] +title HandleMyVideosDbEvent EMPXItemInserted +create ut_collectionplugintest CPTest +CPTest SetVideoListFetching 0 +CPTest HandleMyVideosDbEvent EMPXItemInserted 1 2 +delete CPTest +[Endtest] + +[Test] +title HandleMyVideosDbEvent EMPXItemInserted, list fetching +create ut_collectionplugintest CPTest +CPTest SetVideoListFetching 1 +CPTest HandleMyVideosDbEvent EMPXItemInserted 1 2 +delete CPTest +[Endtest] + +[Test] +title HandleMyVideosDbEvent EMPXItemInserted, cancel cache list fetching +create ut_collectionplugintest CPTest +CPTest CancelCacheListFetching 1 +CPTest HandleMyVideosDbEvent EMPXItemInserted 1 2 +delete CPTest +[Endtest] + +[Test] +title HandleMyVideosDbEvent EMPXItemInserted messagelist leaves +create ut_collectionplugintest CPTest +CPTest SetVideoListFetching 0 +CPTest HandleMyVideosDbEvent EMPXItemInserted KMPXIdLeave 2 +delete CPTest +[Endtest] + +[Test] +title HandleMyVideosDbEvent EMPXItemModified +create ut_collectionplugintest CPTest +CPTest HandleMyVideosDbEvent EMPXItemModified 2 3 +delete CPTest +[Endtest] + +[Test] +title HandleMyVideosDbEvent EMPXItemModified, invalid video +create ut_collectionplugintest CPTest +CPTest HandleMyVideosDbEvent EMPXItemModified KInvalidId +delete CPTest +[Endtest] + +[Test] +title HandleMyVideosDbEvent EMPXItemModified, invalid and valid videos +create ut_collectionplugintest CPTest +CPTest HandleMyVideosDbEvent EMPXItemModified 1 KInvalidId 2 +delete CPTest +[Endtest] + +[Test] +title HandleMyVideosDbEvent EMPXItemModified messagelist leaves +create ut_collectionplugintest CPTest +CPTest SetVideoListFetching 0 +CPTest HandleMyVideosDbEvent EMPXItemModified KMPXIdLeave 2 +delete CPTest +[Endtest] + +[Test] +title AddVideoToMdsAndCacheL +create ut_collectionplugintest CPTest +CPTest CreateNewMedia EMediaGeneralId 1 EMediaTypeVideo +CPTest AddVideoToMdsAndCacheL +delete CPTest +[Endtest] + +[Test] +title SetVideoL id found +create ut_collectionplugintest CPTest +CPTest CreateNewMedia +CPTest SetMediaAttribute EMediaGeneralId 1 EMediaTypeVideo +CPTest AddMediaToCache +CPTest SetVideoL 1 +delete CPTest +[Endtest] + +[Test] +title SetVideoL leave +create ut_collectionplugintest CPTest +allownextresult -20 +CPTest SetVideoL KMPXIdLeave +delete CPTest +[Endtest] + +[Test] +title SetVideoL id not found +create ut_collectionplugintest CPTest +CPTest SetVideoL KMPXIdNotFound +delete CPTest +[Endtest] + +[Test] +title SetVideoL item changed +create ut_collectionplugintest CPTest +CPTest SetVideoL KMPXIdChanged +delete CPTest +[Endtest] + +[Test] +title SendMyVideosMessageL +create ut_collectionplugintest CPTest +CPTest SendMyVideosMessageL 0 KVcxCommandMyVideosGetMediaFullDetailsByMpxId +delete CPTest +[Endtest] + +[Test] +title SendMyVideosMessageL no cmd +create ut_collectionplugintest CPTest +CPTest SendMyVideosMessageL 0 +delete CPTest +[Endtest] + +[Test] +title SendMessages +create ut_collectionplugintest CPTest +CPTest SendMessages +delete CPTest +[Endtest] + +[Test] +title HandleObjectPresentNotification +create ut_collectionplugintest CPTest +CPTest HandleObjectPresentNotification +delete CPTest +[Endtest] + +[Test] +title HandleObjectPresentNotification, cache leaves on reset +create ut_collectionplugintest CPTest +CPTest HandleObjectPresentNotification 1 +delete CPTest +[Endtest] + +[Test] +title NotifyNewVideosCountDecreasedL +create ut_collectionplugintest CPTest +CPTest NotifyNewVideosCountDecreasedL +delete CPTest +[Endtest] + +[Test] +title HandleCreateVideoListResp list incomplete +create ut_collectionplugintest CPTest +CPTest HandleCreateVideoListResp 0 +delete CPTest +[Endtest] + +[Test] +title HandleCreateVideoListResp list complete +create ut_collectionplugintest CPTest +CPTest HandleCreateVideoListResp 1 +delete CPTest +[Endtest] + +[Test] +title HandleCreateVideoListResp list complete, leaves +create ut_collectionplugintest CPTest +CPTest HandleCreateVideoListResp 1 -1 +delete CPTest +[Endtest] + +[Test] +title HandleCreateVideoListResp list incomplete, leaves +create ut_collectionplugintest CPTest +CPTest HandleCreateVideoListResp 0 -1 +delete CPTest +[Endtest] \ No newline at end of file diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/eabi/ut_collectionplugintestu.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/eabi/ut_collectionplugintestu.def Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,5 @@ +EXPORTS + _Z9LibEntryLR13CTestModuleIf @ 1 NONAME + _ZTI22CVcxMdsShutdownMonitor @ 2 NONAME + _ZTV22CVcxMdsShutdownMonitor @ 3 NONAME + diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/group/bld.inf Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Build information file for Collection Plugin unit test module +* +*/ + +// Version : %version: 1 % + + + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +PRJ_TESTEXPORTS +../conf/ut_collectionplugintest.cfg /epoc32/winscw/c/testframework/ut_collectionplugintest.cfg +../init/testframework.ini /epoc32/winscw/c/testframework/testframework.ini + + + +PRJ_MMPFILES +PRJ_TESTMMPFILES +ut_collectionplugintest.mmp + + + +// End of File \ No newline at end of file diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/group/ut_collectionplugintest.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/group/ut_collectionplugintest.mmp Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project ut_collectionplugintest +* +*/ + +// Version : %version: 1 % + + + +#include + +EPOCALLOWDLLDATA + +TARGET ut_collectionplugintest.dll +TARGETTYPE dll +UID 0x1000008D 0x101FB3E3 + +CAPABILITY ALL -TCB + +DEFFILE ut_collectionplugintest.def + +USERINCLUDE ../inc +USERINCLUDE ../../../inc +USERINCLUDE ../../../../inc +USERINCLUDE ../../../../../inc + +SOURCEPATH ../src + +SOURCE ut_collectionplugintest.cpp +SOURCE ut_collectionplugintestBlocks.cpp +SOURCE vcxmyvideosasyncfileoperations_stub.cpp +SOURCE vcxmyvideoscategories_stub.cpp +SOURCE vcxmyvideosmdsdb_stub.cpp +SOURCE vcxmyvideosmessagelist_stub.cpp +SOURCE vcxmyvideosopenhandler_stub.cpp +SOURCE vcxmyvideosvideocache_stub.cpp +SOURCE vcxmyvideoscollectionutil_stub.cpp +SOURCE vcxmyvideosactivetask_stub.cpp +SOURCE vcxmyvideosalbums_stub.cpp +SOURCE vcxmyvideosalbum_stub.cpp +SOURCE vcxmyvideosmdsalbums_stub.cpp + +SOURCEPATH ../../../src +SOURCE vcxmyvideoscollectionplugin.cpp + +APP_LAYER_SYSTEMINCLUDE + +SYSTEMINCLUDE ../inc/ +SYSTEMINCLUDE /epoc32/include/ecom + +LIBRARY ws32.lib +LIBRARY euser.lib +LIBRARY stiftestinterface.lib +LIBRARY stiftestengine.lib +LIBRARY bafl.lib +LIBRARY efsrv.lib +LIBRARY Flogger.lib +LIBRARY mpxcommon.lib +LIBRARY ecom.lib +LIBRARY estor.lib +LIBRARY mdeclient.lib + +LANG SC + +// End of File diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/group/ut_collectionplugintest.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/group/ut_collectionplugintest.pkg Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,42 @@ +; +; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; This component and the accompanying materials are made available +; under the terms of "Eclipse Public License v1.0" +; which accompanies this distribution, and is available +; at the URL "http://www.eclipse.org/legal/epl-v10.html". +; +; Initial Contributors: +; Nokia Corporation - initial contribution. +; +; Contributors: +; +; Description: Package file for Video Playback User Input Handler STIF Unit Test component +; +; Version : %version: % +; +; Installation file for STIF Video Playback User Input Handler in Platform Security Environments +; + +; Languages +&EN + +; Package header +#{"MyVideos Collection Plugin Unit Test"}, (0x101FB3E3), 1, 0, 1, TYPE=SA, RU + +; *Unique (Non-Localized) Vendor name +; This is used in combination with signing to prevent the unauthroized +; upgrade of a a package by someone other than the rightful vendor. +:"Nokia" + +; Series60 product id for S60 3.0 +[0x101F7961], 0, 0, 0, {"Series60ProductID"} + +; Localised Vendor name +%{"Nokia Test EN"} + +; Install files +"/epoc32/release/armv5/udeb/ut_collectionplugintest.dll" - "c:/sys/bin/ut_collectionplugintest.dll" + +"../conf/ut_collectionplugintest.cfg" - "c:/testframework/ut_collectionplugintest.cfg" +"../init/testframework.ini" - "c:/testframework/testframework.ini" diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/mpxlog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/mpxlog.h Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,221 @@ +/* +* ============================================================================ +* Name : mpxlog.h +* Part of : MPX / Common framework +* Description : Debug print macros +* Version : %version: 1 % +* +* Copyright ?2006 Nokia. All rights reserved. +* This material, including documentation and any related computer +* programs, is protected by copyright controlled by Nokia. All +* rights are reserved. Copying, including reproducing, storing, +* adapting or translating, any or all of this material requires the +* prior written consent of Nokia. This material also contains +* confidential information which may not be disclosed to others +* without the prior written consent of Nokia. +* ============================================================================ +* Template version: 4.1 +*/ + +// !! README README README !! + +// This is a modified version for Video Center of the original mpxlog.h file. +// Use enable.cmd to take this version into use and disable.cmd to start +// using the original. Notice that you have to compile sw again to get trace +// changes active. + +// !! README README README !! + +#ifndef MPXLOG_H +#define MPXLOG_H + +// INCLUDES +#include +#include + +#ifdef _DEBUG +#define MPX_PERFORMANCE_LOG +#endif + +// MACROS +#ifdef _DEBUG + +// SELECT LOG TYPE FROM HERE +// 0 = RDebug +// 1 = file logging +// 2 = no logging +#define LOGTYPE 0 + + +#if LOGTYPE == 0 + +#define MPX_DEBUG1(s) { TBuf<250> buf; buf.Append(_L("20016B96: ")); buf.Append(_L(#s)); RDebug::Print( buf ); } +#define MPX_DEBUG2(s, a) { TBuf<250> buf; buf.Append(_L("20016B96: ")); buf.Append(_L(#s)); RDebug::Print( buf, a ); } +#define MPX_DEBUG3(s, a, b) { TBuf<250> buf; buf.Append(_L("20016B96: ")); buf.Append(_L(#s)); RDebug::Print( buf, a, b ); } +#define MPX_DEBUG4(s, a, b, c) { TBuf<250> buf; buf.Append(_L("20016B96: ")); buf.Append(_L(#s)); RDebug::Print( buf, a, b, c ); } +#define MPX_DEBUG5(s, a, b, c, d) { TBuf<250> buf; buf.Append(_L("20016B96: ")); buf.Append(_L(#s)); RDebug::Print( buf, a, b, c, d ); } + +#define MPX_FUNC(fn) TFunctionTrace _s(_L(fn)); +#define MPX_FUNC_EX(fn) TFunctionTrace _s(_L(fn), this); + +#endif + +#if LOGTYPE == 1 + +#include + +_LIT(KIPTVLogFolder2,"IPTV"); +_LIT(KIPTVLogFile2,"IPTVLOG.TXT"); + +#define MPX_DEBUG1(AAA) { _LIT(tempIPTVLogDes,AAA); RFileLogger::Write(KIPTVLogFolder2(),KIPTVLogFile2(),EFileLoggingModeAppend,tempIPTVLogDes()); } +#define MPX_DEBUG2(AAA,BBB) { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KIPTVLogFolder2(),KIPTVLogFile2(),EFileLoggingModeAppend,TRefByValue(tempIPTVLogDes()),BBB); } +#define MPX_DEBUG3(AAA,BBB,CCC) { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KIPTVLogFolder2(),KIPTVLogFile2(),EFileLoggingModeAppend,TRefByValue(tempIPTVLogDes()),BBB,CCC); } +#define MPX_DEBUG4(AAA,BBB,CCC,DDD) { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KIPTVLogFolder2(),KIPTVLogFile2(),EFileLoggingModeAppend,TRefByValue(tempIPTVLogDes()),BBB,CCC,DDD); } +#define MPX_DEBUG5(AAA,BBB,CCC,DDD,EEE) { _LIT(tempIPTVLogDes,AAA); RFileLogger::WriteFormat(KIPTVLogFolder2(),KIPTVLogFile2(),EFileLoggingModeAppend,TRefByValue(tempIPTVLogDes()),BBB,CCC,DDD,EEE); } + +#define MPX_FUNC(fn) TFunctionTrace _s(_L(fn)); +#define MPX_FUNC_EX(fn) TFunctionTrace _s(_L(fn), this); + +#endif + +#if LOGTYPE == 2 + +#define MPX_DEBUG1(AAA) +#define MPX_DEBUG2(AAA,BBB) +#define MPX_DEBUG3(AAA,BBB,CCC) +#define MPX_DEBUG4(AAA,BBB,CCC,DDD) +#define MPX_DEBUG5(AAA,BBB,CCC,DDD,EEE) + +#define MPX_FUNC(fn) +#define MPX_FUNC_EX(fn) + +#endif + + +class TFunctionTrace + { + public: + TFunctionTrace(TRefByValue aName, TAny* aThis=NULL): + iStr(aName), iThis(aThis) + { + if ( iThis ) + { + MPX_DEBUG3("-->%S, 0x%08x",&iStr, iThis); + } + else + { + MPX_DEBUG2("-->%S",&iStr); + } + } + ~TFunctionTrace() + { + if ( iThis ) + { + MPX_DEBUG3("<--%S, 0x%08x",&iStr, iThis); + } + else + { + MPX_DEBUG2("<--%S",&iStr); + } + } + private: + TPtrC iStr; + TAny* iThis; + }; + +// print out (index, id) for each level and the first 15 ids at top level +#define MPX_DEBUG_PATH(aPath) { \ + TInt dlevels = (aPath).Levels();\ + TInt dcount = (aPath).Count();\ + MPX_DEBUG3("Collection Path debug: levels= %d, count = %d", dlevels, dcount);\ + for (TInt i=0; i 0)\ + {\ + TInt index = (aPath).Index();\ + MPX_DEBUG2("Collection Path debug current index %d", index);\ + if (index>=0 && index(&aPath);\ + dpath->SetToFirst();\ + TInt ditem(0);\ + do\ + {\ + MPX_DEBUG3("Collection Path debug top level: item %d = id 0x%08x", ditem, dpath->Id().iId1);\ + } while (++(*dpath) && ++ditem < 15 );\ + dpath->Set(index);\ + }\ + else\ + {\ + MPX_DEBUG1("Collection Path debug: Invalid current index");\ + }\ + }\ + } + +#define MPX_DEBUG_THREAD(ss) { \ + RProcess process; \ + TFullName fullName; \ + process.FullName( fullName ); \ + RThread thisThread; \ + _LIT(_ss, ss); \ + MPX_DEBUG5("%S: process=%S, thread=%d, this=0x%08x", &_ss, &fullName, (TUint)thisThread.Id(), this); \ + } + +#define MPX_S(a) _S(a) +#else +#define MPX_DEBUG1(s) +#define MPX_DEBUG2(s, a) +#define MPX_DEBUG3(s, a, b) +#define MPX_DEBUG4(s, a, b, c) +#define MPX_DEBUG5(s, a, b, c, d) +#define MPX_FUNC(s) +#define MPX_FUNC_EX(fn) +#define MPX_DEBUG_PATH(aPath) +#define MPX_DEBUG_THREAD(ss) +// Copy constant _KMPXErrorInfo and Macros MPX_S and MPX_ERROR_LOG from +// _DEBUG section if intend to log error in release build. +#define MPX_ERROR_LOG(aErr) +#endif + +#ifdef MPX_PERFORMANCE_LOG +#define MPX_PERF_CHECKPT(s) RDebug::Print(_L("--- PERFORMANCE CHECK POINT ---"));\ + RDebug::Print(_L(#s)); +#define MPX_PERF_START(fn) TPerfTrace perf__##fn (_L(#fn)); perf__##fn.Start(); +#define MPX_PERF_END(fn) perf__##fn.End(); +class TPerfTrace + { + public: + TPerfTrace(TRefByValue aName): + iStr(aName) + { + } + void TPerfTrace::Start() + { + iTime.UniversalTime(); + MPX_DEBUG2("-->%S",&iStr); + } + void TPerfTrace::End() + { + TTime now; + now.UniversalTime(); + TInt delta = I64INT(now.MicroSecondsFrom(iTime).Int64()); + MPX_DEBUG3("<--%S, time taken %d us", &iStr, delta); + } + private: + TPtrC iStr; + TTime iTime; + }; +#else +#define MPX_PERF_CHECKPT(s) +#define MPX_PERF_START(fn) +#define MPX_PERF_END(fn) +#endif + +#define MPX_TRAP(_r, _s) TRAP(_r,_s);MPX_ERROR_LOG(_r); +#define MPX_TRAPD(_r, _s) TRAPD(_r,_s);MPX_ERROR_LOG(_r); + +#endif // MPXLOG_H + +// End of File diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/ut_collectionplugintest.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/ut_collectionplugintest.h Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,236 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: video Playback User Input Handler test class for STIF testing +* +*/ + +// Version : %version: 1 % + +#ifndef COLLECTIONPLUGIN_TEST_H +#define COLLECTIONPLUGIN_TEST_H + +// INCLUDES +#include +#include +#include +#include +#include +#include +#include +#include + +//#include "mpxlog.h" +//#include "mpxvideo_debug.h" +#include + +#include +#include +#include +#include +#include "vcxmyvideosactivetask.h" +#include "vcxmyvideosmdsdb_stub.h" +#include "vcxmyvideosvideocache_stub.h" + +#define private public +#include "vcxmyvideoscollectionplugin.h" +#undef private + +// CLASS DECLARATION + +class CMPXMedia; +class CVcxMyVideosMdsDb; +class CMPXResource; +class CMPXMediaArray; +//class CVcxMyVideosDownloadUtil; +class CVcxMyVideosVideoCache; +class CVcxMyVideosCategories; +class CVcxMyVideosMessageList; +class CVcxMyVideosAsyncFileOperations; +class CVcxMyVideosOpenHandler; +class CCollectionPluginTest; +class CVcxMyVideosCollectionPlugin; +class MMPXCollectionPluginObserver; + +// DATA + +// CONSTANTS + + +// MACROS +#define TEST_CLASS_VERSION_MAJOR 0 +#define TEST_CLASS_VERSION_MINOR 0 +#define TEST_CLASS_VERSION_BUILD 0 + +// Logging path +_LIT( KCollectionplugintest_LogPath, "\\logs\\testframework\\collectionplugintest\\" ); + +// Log file +_LIT( KCollectionplugintest_LogFile, "collectionplugintest.txt" ); +_LIT( KCollectionplugintest_LogFileWithTitle, "collectionplugintest[%S].txt" ); + + +/** +* CCollectionPluginTest class for STIF Test Framework TestScripter. +* ?other_description_lines +* +* @lib ?library +* @since ?Series60_version +*/ +NONSHARABLE_CLASS(CCollectionPluginTest) : public CScriptBase, MMPXCollectionPluginObserver +{ + public: // Constructors and destructor + + /** + * Two-phased constructor. + */ + static CCollectionPluginTest* NewL( CTestModuleIf& aTestModuleIf ); + + /** + * Destructor. + */ + virtual ~CCollectionPluginTest(); + + public: // Functions from base classes + + /** + * From CScriptBase Runs a script line. + * @since ?Series60_version + * @param aItem Script line containing method name and parameters + * @return Symbian OS error code + */ + virtual TInt RunMethodL( CStifItemParser& aItem ); + + private: + + /** + * C++ default constructor. + */ + CCollectionPluginTest( CTestModuleIf& aTestModuleIf ); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void CreateL(); + + /** + * Frees all resources allocated from test methods. + * @since ?Series60_version + */ + void Delete(); + + /** + * LogMethod + */ + void LogMethod( TPtrC aMethod ); + + /** + * DeleteStubL + */ + TInt DeleteStubL( CStifItemParser& aItem ); + + /** + * CheckCurrentCmd + * + * Checks current command in vcxmyvideosactivetask + */ + TInt CheckCurrentCmdL( CStifItemParser& aItem ); + + /** + * Method used to log version of test class + */ + void SendTestClassVersion(); + + virtual TInt SetVideoListFetchingL( CStifItemParser& aItem ); + virtual TInt CancelCacheListFetchingL( CStifItemParser& aItem ); + + CMPXCommand* CreateMpxCommandLC( TInt aCommandGeneralId, TInt aMyVideosCommandId, TBool aSync ); + virtual TInt CreateNewCmdL( CStifItemParser& aItem ); + virtual TInt SetNewCmdL( CStifItemParser& /*aItem*/ ); + virtual TInt CreateNewMediaL( CStifItemParser& aItem ); + virtual TInt AddMediaToCacheL( CStifItemParser& /*aItem*/ ); + virtual TInt SetMediaAttributeL( CStifItemParser& aItem ); + virtual TInt SelectAttributesL( CStifItemParser& aItem ); + + /** + * Set iPath + */ + virtual TInt InsertToPathL( CStifItemParser& aItem ); + virtual TInt SelectPathL( CStifItemParser& aItem ); + virtual TInt SelectPathIdL( CStifItemParser& aItem ); + virtual TInt RemoveMediaFromCacheL( CStifItemParser& aItem ); + virtual TInt CheckMediaCountL( CStifItemParser& aItem ); + + // TEST FUNCS + virtual TInt OpenL( CStifItemParser& aItem ); + virtual TInt MediaL( CStifItemParser& aItem ); + virtual TInt CancelRequest( CStifItemParser& aItem ); + virtual TInt CommandL( CStifItemParser& aItem ); + virtual TInt FindAllL( CStifItemParser& aItem ); + virtual TInt FindAllSyncL( CStifItemParser& aItem ); + virtual TInt GetCapabilities( CStifItemParser& aItem ); + virtual TInt AddL( CStifItemParser& aItem ); + virtual TInt RemoveL( CStifItemParser& aItem ); + virtual TInt SetL( CStifItemParser& aItem ); + virtual TInt HandleStepL( CStifItemParser& aItem ); + virtual TInt HandleMyVideosDbEvent( CStifItemParser& aItem ); + virtual TInt HandleCreateVideoListResp( CStifItemParser& aItem ); + virtual TInt HandleObjectPresentNotificationL( CStifItemParser& aItem ); + virtual TInt AddVideoToMdsAndCacheL( CStifItemParser& aItem ); + virtual TInt SetVideoL( CStifItemParser& aItem ); + virtual TInt SendMyVideosMessageL( CStifItemParser& aItem ); + virtual TInt SendMessages( CStifItemParser& aItem ); + virtual TInt CategoriesL( CStifItemParser& aItem ); + virtual TInt NotifyNewVideosCountDecreasedL( CStifItemParser& aItem ); + virtual TInt AlbumsL( CStifItemParser& aItem ); + + + public: // from observer + virtual void HandleMessage(const CMPXMessage& aMsg) + { + HandleMessage(const_cast(&aMsg), KErrNone); + } + virtual void HandleMessage(CMPXMessage* /*aMsg*/, TInt /*aError*/); + virtual void HandleOpen(CMPXMedia* aMedia, TInt aErr); + virtual void HandleOpen(CMPXCollectionPath* aPath, TInt aErr); + virtual void HandleOpen(CMPXMedia* aMedia, const CMPXCollectionPath* aPath, TInt aErr); + + virtual void HandleMedia(CMPXMedia* aMedia, TInt aError); + virtual void HandleCommandComplete(CMPXCommand* aCommandResult, TInt aError); + virtual void HandleRemove(const CDesCArray& aUriArray, TInt aError); + virtual void HandleFindAll(CMPXMedia* aMedia, TInt aError); + + private: + + TUid iCollectionUid; + + // Tested class + CVcxMyVideosCollectionPlugin* iCollection; + + CMPXCollectionPath* iPath; + RArray iAttrs; + + CMPXMediaArray* iMessageList; + + CMPXMedia* iMedia; + CMPXCommand* iCommand; +}; + +#endif // COLLECTIONPLUGIN_TEST_H + +// End of File diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosactivetask.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosactivetask.h Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,176 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active object to split up long running tasks* +*/ + + + +#ifndef VCXMYVIDEOSACTIVETASK_H +#define VCXMYVIDEOSACTIVETASK_H + +#include +#include + +/** +* Observer class to the active task object +*/ +NONSHARABLE_CLASS( MVcxMyVideosActiveTaskObserver ) + { +public: + + enum TStepResult + { + EMoreToCome, + EDone, + /** + * Observer is responsible for calling Done or ContinueStepping if returning this. + */ + EStopStepping + }; + + /** + * Handle the execution of a step + * @return TStepResult + */ + virtual TStepResult HandleStepL() = 0; + /** + * Handle the completion of the operation + */ + virtual void HandleOperationCompleted( TInt aErr ) = 0; + }; + +/** + * Active object to execute tasks in multiple steps. + * Each collection plugin has its own task queue, which serializes all + * operations for a plugin. + */ +NONSHARABLE_CLASS( CVcxMyVideosActiveTask ) : public CActive + { +public: + /** + * Two-phased constructor + */ + static CVcxMyVideosActiveTask* NewL( MVcxMyVideosActiveTaskObserver& aObserver ); + + /** + * Destructor + */ + virtual ~CVcxMyVideosActiveTask(); + +public: // Accessor functions + + /** + * Start the async command task + * @param aTask task id + * @param aCommand command for the operation + */ + void StartL( TMPXCommandId aTask, const CMPXCommand& aCommand ); + + /** + * Get the current step for the current task + * @return the current step + */ + TInt GetStep(); + + /* + * Get the command for the current task + * @return the current task + */ + TMPXCommandId GetTask(); + + /** + * Get the command for the current task + * @return the current command + */ + CMPXCommand& GetCommand(); + + /** + * Get the command for the current task. + * @return the current command, ownership does not move. + */ + CMPXMedia* Command(); + + /** + * If observer returns EStopStepping from HandleStepL, then observer must call + * this or ContinueStepping when sub operation is finished. + * Can be used to run async operations. + */ + void Done(); + + /** + * If observer returns EStopStepping from HandleStepL, then observer must call + * this or Done when sub operation is finished. + * Can be used to run async operations. + */ + void ContinueStepping(); + + /** + * Add some functionality to CActive::Cancel + */ + void Cancel(); + + /* + * Test function; set new command + */ + void SetNewCommandL( const CMPXCommand& aCommand ); + +protected: // From base class + + /** + * From CActive + */ + void RunL(); + + /** + * From CActive + */ + void DoCancel(); + + /** + * From CActive + */ + TInt RunError( TInt aError ); + +private: + + /** + * Default Constructor + */ + CVcxMyVideosActiveTask(MVcxMyVideosActiveTaskObserver& aObserver); + + /** + * 2nd-phase Constructor + */ + void ConstructL(); + +public: + /** + * Set to ETrue when stepping is stopped. + * Cancel or Done has to be called. + */ + TBool iStopped; + +private: // data + + CMPXCommand* iCurCommand; // Current Command + TMPXCommandId iCurTask; // The task command id + TInt iCurStep; // The n-th stop in the operation + MVcxMyVideosActiveTaskObserver& iObserver; // Observer + +public: // Friend classes + + friend class CCollectionPluginTest; + }; + +#endif // VCXMYVIDEOSACTIVETASK_H diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosalbum.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosalbum.h Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,219 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* + +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class representing album in My Videos collection. +*/ + + +#ifndef CVCXMYVIDEOSALBUM_H +#define CVCXMYVIDEOSALBUM_H + +// INCLUDES +#include +#include + +class CMPXMedia; +class CVcxMyVideosCollectionPlugin; + +// CLASS DECLARATION + +/** + * Contains information about video which belongs to some album. + * These are stored to CVcxMyVideosAlbum::iVideoList. + */ +NONSHARABLE_CLASS(TVcxMyVideosAlbumVideo) + { + public: + + /** + * Constructor. + */ + TVcxMyVideosAlbumVideo(); + + /** + * = operator. + */ + TVcxMyVideosAlbumVideo& operator=( const TVcxMyVideosAlbumVideo& aVideo ); + private: + + /** + * Set values. + */ + void Set( TUint32 aMdsId, TUint32 aRelationMdsId, CMPXMedia* aVideo ); + + public: + TUint32 iMdsId; //Video object ID in MDS. + TUint32 iRelationMdsId; //Relation ID in MDS, this is used when removing items from album. + CMPXMedia* iMedia; + }; + +/** + * Contains list of videos belonging to an album. Videos can be searched, added and + * removed. Videos are kept in sorting order by MDS ID to speed up access. Pointers + * to media objects in collection cache are also stored to speed up access. + * Contains also logic for keeping album media attributes up to date. + */ +NONSHARABLE_CLASS(CVcxMyVideosAlbum) : public CBase + { +public: + // Constructors and destructor + + /** + * Destructor. + */ + ~CVcxMyVideosAlbum(); + + /** + * Two-phased constructor. + */ + static CVcxMyVideosAlbum* NewL( CVcxMyVideosCollectionPlugin& aCollectionPlugin ); + + /** + * Two-phased constructor. + */ + static CVcxMyVideosAlbum* NewLC( CVcxMyVideosCollectionPlugin& aCollectionPlugin ); + + // new methods + + /** + * Sets up this album. + * + * @param aAlbum Media class to set from. + */ + void SetL( /*CMPXMedia& aAlbum*/ ); + + /** + * Sorts iVideoList by MDS ID. + */ + void Sort(); + + /** + * Checks if aMdsId belongs to this album. Checking is + * done using bisection method. + * + * @param aMdsId Id to check. + */ + TBool BelongsToAlbum( TUint32 aMdsId ); + + /** + * Finds video from iVideoList. Uses bisection method, ie + * is fast. + * + * @param aMdsId Video to find. + * @param aVideo If found, this is filled with data. + * @param aIndex Position in iVideoList where from the video + * was found. + * @return System-wide error code. If != KErrNone, then + * aVideo and aIndex won't contain valid data. + */ + TInt Video( TUint32 aMdsId, TVcxMyVideosAlbumVideo& aVideo, TInt& aIndex ); + + /** + * Adds aVideo to this album. The id array is kept in ascending order. + * + * @param aVideo Video to add. + */ + void AddL( TVcxMyVideosAlbumVideo aVideo ); + + /** + * Removes videos from this album. + * + * @param aMdsIds Array containing IDs of the videos to remove. + */ + void Remove( RArray& aMdsIds ); + + /** + * Removes aMdsId from this album. + * + * @param aMdsId ID to remove. + * @param aCompress If ETrue, then Compress is called to iVideoList. + * ETrue as default. + */ + void Remove( TUint32 aMdsId, TBool aCompress = ETrue ); + + /** + * Used for keeping RArray in integer order by + * TVcxMyVideosAlbumVideo::iMdsId. + * + * @param aVideo1 Video to compare + * @param aVideo2 Video to compare + * @return -1 if aVideo1 is smaller than aVideo2, 1 if aVideo1 is larger than + * aVideo2. + */ + static TInt CompareVideosByMdsId( const TVcxMyVideosAlbumVideo& aVideo1, + const TVcxMyVideosAlbumVideo& aVideo2 ); + + /** + * Creates video list belonging to this album. Ownership goes to caller. + * + * @return Media containing media array. Array items are videos. + */ + CMPXMedia* CreateVideoListL(); + + /** + * Appends items from aFromVideoList to aToVideoList if they belong to + * this album. + * + * @param aFromVideoList From list. + * @param aToVideoList To List. + * @param aNewItemStartIndex Start index of the copy. Items in aFromVideoList before this + * value are ignored. + */ + void AppendToVideoListL( CMPXMedia& aFromVideoList, + CMPXMedia& aToVideoList, TInt aNewItemStartIndex ); + + /** + * Calculates KVcxMediaMyVideosCategoryItemCount, KVcxMediaMyVideosCategoryNewItemCount, + * KVcxMediaMyVideosCategoryNewItemName and KMPXMediaGeneralDate attributes to iMedia. + * + * @return Returns ETrue if album attributes were modified, EFalse otherwise. + */ + TBool CalculateAttributesL(); + +private: + + /** + * Constructor for performing 1st stage construction + */ + CVcxMyVideosAlbum( CVcxMyVideosCollectionPlugin& aCollectionPlugin ); + + /** + * EPOC default constructor for performing 2nd stage construction + */ + void ConstructL(); + +private: //data + CVcxMyVideosCollectionPlugin& iCollection; + +public: //data + + /** + * MDS ID of this album. + */ + TUint32 iMdsId; + + /** + * MPX media object representing this album in collection, not own. + * The item is owned by CVcxMyVideosAlbums::iAlbumList + */ + CMPXMedia* iMedia; + + /** + * Array containing info about videos belonging to this album. + */ + RArray iVideoList; + + }; + +#endif // CVCXMYVIDEOSALBUM_H diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosalbums.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosalbums.h Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,371 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Albums related collection functionality. +*/ + + + +#ifndef VCXMYVIDEOSALBUMS_H +#define VCXMYVIDEOSALBUMS_H + +// INCLUDES +#include +#include "vcxmyvideosmdsdb_stub.h" +#include "vcxmyvideosalbum.h" + +// FORWARD DECLARATIONS +class CVcxMyVideosMdsDb; +class CMPXMedia; +class CVcxMyVideosCollectionPlugin; +class CVcxMyVideosAlbum; + +// CONSTANTS + +// CLASS DECLARATION + +/** +* Albums related collection functionality. +* +* @lib mpxmyvideoscollectionplugin.lib +*/ +NONSHARABLE_CLASS(CVcxMyVideosAlbums) : public CBase, public MVcxMyVideosMdsAlbumsObserver + { + public: // Constructors and destructor + + /** + * Two-phased constructor + * @return object constructed + */ + static CVcxMyVideosAlbums* NewL( CVcxMyVideosCollectionPlugin& aCollectionPlugin ); + + /** + * Destructor + */ + virtual ~CVcxMyVideosAlbums(); + + public: // new methods + + /** + * Returns album from iAlbums array by MDS ID. Ownership does not move. + * + * @param aMdsId MDS ID of the album to get. + * @param aPos If given, then the position index in iAlbums is written here. + * Ownership does not move. + * @return Pointer to album or NULL if not found. + */ + CVcxMyVideosAlbum* Album( TUint32 aMdsId, TInt* aPos = NULL ); + + /** + * Creates iAlbumList if it doesn't exist yet. The list is populated + * from async callback, HandleGetAlbumsResp(). + */ + void CreateAlbumListL(); + + /** + * Fetches MDS IDs from MDS for all videos belonging to albums. + * Ie fills iAlbums[*]->iVideoList[*].iMdsId (and iAlbums[*]->iVideoList[*].iRelationMdsId) fields. + * Causes several async calls to MDS. + */ + void GetAlbumContentIdsL(); + + /** + * Adds videos to album. + * + * @param aCmd See attribute usage from vcxmyvideosdefs.h. + */ + void AddVideosToAlbumL( CMPXMedia* aCmd ); + + /** + * Removes videos from album. + * + * @param aCmd See attribute usage from vcxmyvideosdefs.h. + */ + void RemoveVideosFromAlbumL( CMPXMedia* aCmd ); + + /** + * Adds album to MDS and to this class. KMPXMediaGeneralTitle + * should be set in aCmd. Upon completion, the KMPXMediaGeneralId + * attribute contains the new MPX item ID. Leaves if could + * not add to MDS. + * + * @param aCmd Command object received from collection client. + */ + void AddAlbumL( CMPXMedia& aCmd ); + + /** + * Removes albums from MDS. MDS delete events will clean up albums + * from this class. + * + * @param aCmd MPX command received from the client. Contains media array, + * which contains medias with album IDs set to KMPXMediaGeneralId. + * Ownership does not move. + */ + void RemoveAlbumsFromMdsOnlyL( CMPXMedia* aCmd ); + + /** + * Removes albums from this object (iAlbumList and iAlbums). + * Called from MDS delete event. Album IDs which were removed are + * also removed from aAlbumIds array. After the call aAlbumIds + * will contain items which were not found and not deleted. + * Sends appropriate events to collection client. + * + * @param aAlbumIds Album IDs to be removed. + */ + void RemoveAlbumsL( RArray& aAlbumIds ); + + /** + * Removes album from this class (iAlbumList and iAlbums). + * Adds event to message list but does not send it. + * + * @param aMdsIds Album MDS ID to be removed. + * @param aCompress If ETrue, then iAlbums is compressed, + * otherwise not. + * @return ETrue if album was found and removed. + */ + TBool RemoveAlbumL( TUint32 aMdsId, TBool aCompress ); + + /** + * Fetches albums from MDS. This is called from MDS insert event. + * + * @param aAlbumIds Album IDs to fetch. + */ + void AddAlbumsFromMdsL( RArray& aAlbumIds ); + + /** + * Updates albums from MDS. This is called from MDS modify event. + * + * @param aAlbumIds Album IDs to update. + */ + void UpdateAlbumsFromMdsL( RArray& aAlbumIds ); + + /** + * Updates album attributes, does not write to MDS. Adds + * modify event to iCollection.iMessageList if necessarry. + * + * @param aAlbum New values are read from this. + * @return ETrue if album was modified, EFalse otherwise. + */ + TBool UpdateAlbumL( const CMPXMedia& aAlbum ); + + /** + * Calculates and updates album media attributes. + * Adds events to iCollection.iMessageList if albums + * are modified. Does not send them. + * + * @return Returns ETrue if events were added to iCollection.iMessageList, + * EFalse otherwise. + */ + TBool CalculateAttributesL(); + + /** + * Called when video's New Video flag changes. Calculates + * album attributes for the affected albums. Adds events + * to iCollection.iMessageList but does not send them. + * + * @param aMdsId MDS ID of the changed video. + */ + void NewVideoFlagChangedL( TUint32 aMdsId ); + + /** + * Called when video's title changes. Calculates + * album attributes for the affected albums. Adds events + * to iCollection.iMessageList but does not send them. + * + * @param aMdsId MDS ID of the changed video. + */ + void VideoTitleChangedL( TUint32 aMdsId ); + + /** + * Called when video is added or removed from cache. Adds changed + * album indexes to iChangedAlbums. + */ + void VideoAddedOrRemovedFromCacheL( CMPXMedia& video ); + + /** + * Goes through iChangedAlbums and updates album attributes and adds + * changed events. + */ + void UpdateChangedAlbumsL(); + +protected: + + /** + * From MVcxMyVideosMdsAlbumsObserver. + * Process albums arriving from MDS. Response to VcxMyVideosMdsAlbums::GetAlbumsL. + */ + void HandleGetAlbumsRespL( CMPXMedia* aAlbumList ); + + /** + * From MVcxMyVideosMdsAlbumsObserver. + * Process content ids arriving from MDS. Response to VcxMyVideosMdsAlbums::GetAlbumContentIdsL. + * + * @param aAlbumId ID of the album. + * @param aAlbumContent Array containing MDS object IDs. This array is the same which + * was given in GetAlbumContentIdsL call. + */ + void HandleGetAlbumContentIdsRespL( TUint32 aAlbumId, + RArray& aAlbumContentIds ); + + /** + * From MVcxMyVideosMdsAlbumsObserver. + * Response to VcxMyVideosMdsAlbums::GetAlbumsL. + * Sends insert events to collection clients. + * + * @param aAlbumList Pointer to same array which was given in GetAlbums call. + */ + void HandleGetAlbumsResp( CMPXMedia* aAlbumList ); + + /** + * From MVcxMyVideosMdsAlbumsObserver. + * Process content ids arriving from MDS. Response to CVcxMyVideosMdsAlbums::GetAlbumContentIdsL. + * + * @param aAlbumId ID of the album. + * @param aAlbumContent Array containing MDS object IDs. This array is the same which + * was given in GetAlbumContentL call. + */ + void HandleGetAlbumContentIdsResp( TUint32 aAlbumId, + RArray& aAlbumContentIds ); + + /** + * From MVcxMyVideosMdsAlbumsObserver. + * Process content videos arriving from MDS. Response to CVcxMyVideosMdsAlbums::GetAlbumContentVideosL. + * + * @param aAlbumId Album ID. + * @param aVideoList Media containing media array, array items are videos. + * @param aError Error code in case of failure. + * @param aFirstNewItemIndex The index of the first new item. + * @param aNewItemCount How many new items since the last results. + * @param aComplete ETrue is query is complete, EFalse if there is new to come. + */ + void HandleGetAlbumContentVideosResp( TUint32 /*aAlbumId*/, CMPXMedia& /*aVideoList*/, + TInt /*aError*/, TInt /*aFirstNewItemIndex*/, TInt /*aNewItemCount*/, TBool /*aComplete*/ ) {} + + /** + * From MVcxMyVideosMdsAlbumsObserver. + * Response to CVcxMyVideosMdsAlbums::AddVideosToAlbumL. + * + * @param aCmd Pointer to object which was given in AddVideosToAlbumL + * function call. Ownership does not move. + * @param aItemArray Item array which was tried to add to MDS. + */ + void HandleAddVideosToAlbumResp( CMPXMedia* aCmd, + RPointerArray& aItemArray ); + + /** + * From MVcxMyVideosMdsAlbumsObserver. + * Response to CVcxMyVideosMdsAlbums::RemoveRelationsL. + */ + void HandleRemoveRelationsResp( RArray& aRelationIds, + RArray& aResults ); + + /** + * From MVcxMyVideosMdsAlbumsObserver. + * Response to CVcxMyVideosMdsAlbums::RemoveAlbumsL. + */ + void HandleRemoveAlbumsResp( CMPXMedia* aCmd, + RArray& aResultIds ); + + /** + * From MVcxMyVideosMdsAlbumsObserver. + * Relation events from MDS. This object is set as an observer at + * iCollection.ConstructL, CVcxMyVideosMdsDb::NewL(..,aAlbumsObserver,..). + */ + void HandleRelationEvent( TObserverNotificationType aType, + const RArray& aRelationArray ); + + private: + + /** + * Fills in iAlbums array. This is called when iAlbumList is ready. + * Pointers to CVcxMyVideosVideoCache::iVideoList are not filled + * in yet. + */ + void CreateAlbumsL(); + + /** + * Constructor + */ + CVcxMyVideosAlbums( CVcxMyVideosCollectionPlugin& aCollectionPlugin ); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL(); + + /** + * Leaving version of HandleAddVideosToAlbumResp. + */ + void DoHandleAddVideosToAlbumRespL( CMPXMedia* aCmd, + RPointerArray& aItemArray ); + + public: + + /** + * Album list. This is given to client when categorylevel items are requested. Own. + * If this is destroyed/edited, then pointers have to be updated in iAlbums. + */ + CMPXMedia* iAlbumList; + + /** + * Array containing MDS IDs and pointers to album and video media items. + * Album media items are in iAlbumList and video media items are in + * CVcxMyVideosVideoCache::iVideoList. + */ + RArray iAlbums; + + /** + * ETrue when iAlbumList is ready and iAlbums contains video IDs. + */ + TBool iAlbumListIsComplete; + + private: + + /** + * Owner of this object. + */ + CVcxMyVideosCollectionPlugin& iCollection; + + /** + * Used in MDS operations to store MDS video (or relation) IDs. + */ + RArray iMdsOpTargetIds; + + /** + * Stores album video data during relation deletion. This is to + * avoid second search when resp arrives. + */ + RArray iRemoveFromAlbumVideos; + + /** + * Used in MDS operations to store operation results. Is in sync with iMdsOpTargetIds. + */ + RArray iMdsOpResults; + + /** + * Used in MDS operations to store operation results. Is in sync with iMdsOpTargetIds. + */ + RArray iMdsOpResultsUint32; + + /** + * When videos are removed or added from cache, the indexes of the + * changed albums are stored here. Reason is to calculate new attributes + * only once per changed album. + */ + RArray iChangedAlbums; + + }; + +#endif // VCXMYVIDEOSALBUMS_H + + diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosasyncfileoperations_stub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosasyncfileoperations_stub.h Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,251 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for MPX My Videos Collection Move, Copy and Delete operations.* +*/ + + + + +#ifndef VCXMYVIDEOSASYNCFILEOPERATIONS_H +#define VCXMYVIDEOSASYNCFILEOPERATIONS_H + +// INCLUDES + +#include +#include +#include +#include + +// FORWARD DECLARATIONS +class CVcxMyVideosCollectionPlugin; +class CVcxMyVideosAsyncFileCopy; +class CMPXMedia; + +// CONSTANTS + +// CLASS DECLARATION + +/** +* @lib mpxmyvideoscollectionplugin.lib +*/ +NONSHARABLE_CLASS(CVcxMyVideosAsyncFileOperations) : + public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor + * @return object constructed + */ + static CVcxMyVideosAsyncFileOperations* NewL( CVcxMyVideosCollectionPlugin& aCollection ); + + /** + * Destructor + */ + virtual ~CVcxMyVideosAsyncFileOperations(); + + public: // from base classes + + private: + /** + * Constructor + */ + CVcxMyVideosAsyncFileOperations( CVcxMyVideosCollectionPlugin& aCollection ); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL (); + + public: + + /** + * Deletes the file and removes media item from the collection. + * + * @param aMdsId MDS id of the item to be deleted. + * @param aForce If ETrue, the video will be deleted even if download is ongoing. + */ + void DeleteVideoL( TUint32 aMdsId, TBool aForce = EFalse ); + + /** + * Performs one Move or Copy operation. Called by HandleStep. + * + * @return MVcxMyVideosActiveTaskObserver::EDone if was last operation, + * MVcxMyVideosActiveTaskObserver::EMoreToCome otherwise. + */ + MVcxMyVideosActiveTaskObserver::TStepResult HandleMoveOrCopyStepL(); + + /** + * Moves or copies video to another drive. + * + * @param aMdsId MDS id of the item to be moved. + * @param aMove If ETrue, the source file is deleted. + */ + void MoveOrCopyVideoL( TUint32 aMdsId ); + + /** + * Generates and sends resp message for Move,Copy and Delete operations. + * Does nothing if there is some other operation going on. + * This function is called when operation is interrupted from a leave or + * cancel request. + * Leaves with KErrNotFound if no operation was in progress. + * + * @param aErr Error code which is set for non handled items in the resp array. + */ + void CancelOperationL( TInt aErr ); + + /** + * Performs one Delete operation. Called by HandleStep. + * + * @return MVcxMyVideosActiveTaskObserver::EDone if was last operation, + * MVcxMyVideosActiveTaskObserver::EMoreToCome otherwise. + */ + MVcxMyVideosActiveTaskObserver::TStepResult HandleDeleteStepL(); + + private: + + /** + * Called when file is going to be moved or copied to aDrive. + * Checks if target drive has enough free space. + * + * @param aPath File path of the file which is going to be moved or copied. + * @param aDrive Target drive. + * @return ETrue If target drive has enough space, EFalse otherwise. + */ + TBool DriveHasEnoughFreeSpaceL( const TDesC& aPath, TInt aDrive ); + + /** + * Sends response array for Move, Copy or Delete operation. + * + * @param aMessageId Response message ID. + */ + void SendOperationRespL( TInt aCmdId ); + + /** + * Generates target path for move and copy operations. + * + * @param aSourcePath Full source path. + * @param aTargetPath Target path is written here. + * @param aTargetDrive Target drive. + */ + void GenerateTargetPathForMoveOrCopyL( + const TDesC& aSourcePath, TDes& aTargetPath, TInt aTargetDrive ); + + /** + * Initializes member variables for the Copy or Move operations. + * + * @param aCmd Command received from collection client. + */ + void InitMoveOrCopyOperationsL( CMPXMedia& aCmd ); + + /** + * Called when file copying completes in Move or Copy operations. + * + * @param aErr Result code of the file copy. + */ + void HandleFileCopyCompletedL( TInt aErr ); + + /** + * Initializes MDS and collection cache before the actual file copy. + * Does some sanity checks also. + * + * @param aMdsId MDS ID of the video being moved/copied. + */ + void InitSingleMoveOrCopyL( TUint32 aMdsId ); + + public: + + /** + * Array containing item ids which are being moved/copied or deleted. + */ + RArray iOperationIdArray; + + /** + * Array containing results for move/copy/delete operations. Array positions + * are in sync with iOperationIdArray. + */ + RArray iOperationResult; + + private: + + /** + * File server session. + */ + RFs iFs; + + /** + * The item currently being moved/copied or deleted. + */ + TInt iCurrentOperationIndex; + + /** + * Target drive for Move or Copy operation. + */ + TInt iTargetDrive; + + /** + * Set to ETrue if current operation is Move. + */ + TBool IsMoveOperation; + + /** + * Owner of this class. + */ + CVcxMyVideosCollectionPlugin& iCollection; + + /** + * Performs single file copy in multiple steps. + * Used to avoid long blockings when copying large files. + * Own. + */ + CVcxMyVideosAsyncFileCopy* iFileCopier; + + /** + * New media which is created to collection cache in copy operation. + * It is stored in memeber variable in case that file operations + * fail and we have to roll MDS and cache back. Own. + */ + CMPXMedia* iMediaForCopyOp; + + /** + * Updated media which is changed in move operation. + * It is stored in memeber variable in case that file operations + * fail and we have to roll MDS and cache back. Own. + */ + CMPXMedia* iMediaForMoveOp; + + /** + * Source path for move or copy operation. + */ + TFileName iSourcePath; + + /** + * Target path for move or copy operation. + */ + TFileName iTargetPath; + + /** + * Flag for move operation is stored just to avoid accessing + * CMPXMedia object too much. + */ + TBool iIsMoveOperation; + + public: // Friend classes + + friend class CCollectionPluginTest; + }; + +#endif // VCXMYVIDEOSASYNCFILEOPERATIONS_H + + diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideoscategories_stub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideoscategories_stub.h Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,374 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Categories related functionality* +*/ + + + + +#ifndef VCXMYVIDEOSCATEGORIES_H +#define VCXMYVIDEOSCATEGORIES_H + +// INCLUDES + +#include + +// FORWARD DECLARATIONS +class CMPXMedia; +class CVcxMyVideosCollectionPlugin; + +// CONSTANTS + +// CLASS DECLARATION + +/** +* MPX My Videos collection categories implementation. +* +* @lib mpxmyvideoscollectionplugin.lib +*/ +NONSHARABLE_CLASS(CVcxMyVideosCategories) : CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor + * @return object constructed + */ + static CVcxMyVideosCategories* NewL ( CVcxMyVideosCollectionPlugin& aCollection ); + + /** + * Destructor + */ + virtual ~CVcxMyVideosCategories(); + + /** + * Creates Media container with categories. + */ + CMPXMedia* CreateCategoryListL(); + + public: // new methods + + /** + * When CVcxMyVideosVideoCache::iCache->iVideoList is grown (appended), + * this is called to update category attributes. + * + * @param aVideoList Current video list cache. + * @param aNewItemsStartIndex Start position of new items. + */ + void UpdateCategoriesL( CMPXMedia& aVideoList, TInt aNewItemsStartIndex ); + + /** + * Called after video is added to iCollection.iCache. + * Updates category variables accordingly. + * Modify events to iCollection.iMessageList are added, but the list + * is not sent. + * + * @param aMdsId Item which was added. + */ + void VideoAddedL( TUint32 aMdsId ); + + + /** + * Called after video is added to iCollection.iCache. + * Updates category variables accordingly. + * Modify events to iCollection.iMessageList are added, but the list + * is not sent. + * + * @param aVideo Item which was added. + */ + void VideoAddedL( CMPXMedia& aVideo ); + + /** + * Called after videos are added to iCollection.iCache. + * Updates category variables accordingly. + * Modify events to iCollection.iMessageList are added, but the list + * is not sent. + * + * @param aIds Items which were added. + */ + void VideosAddedL( RArray& aIds ); + + /** + * Called just _before_ video is removed from iCollection.iCache. + * Updates category variables accordingly. + * Modify events to iCollection.iMessageList are added, but the list + * is not sent. + * + * @param aMdsId Item which is being removed. + */ + void VideoRemovedL( TUint32 aMdsId ); + + /** + * Called just _before_ video is removed from iCollection.iCache. + * Updates category variables accordingly. + * Modify events to iCollection.iMessageList are added, but the list + * is not sent. + * + * @param aVideo Item which is being removed. + */ + void VideoRemovedL( CMPXMedia& aVideo ); + + /** + * Called just _before_ videos are removed from iCollection.iCache. + * Updates category variables accordingly. + * Modify events to iCollection.iMessageList are added, but the list + * is not sent. + * + * @param aIds Items which are being removed. + */ + void VideosRemovedL( RArray& aIds ); + + /** + * Resets video counters to 0 from categories. Does not + * send events. + */ + void ResetVideoCountersL(); + + /** + * Updates categories' New Video Name fields. + * Sends iCollection.iMessageList if any of the categories is modified. + */ + void UpdateCategoriesNewVideoNamesL(); + + + /** + * Called when video is updated in a way it affects New Video Name (and date) in category. + * This updates the category accordinly. This function adds modify events to + * collections message list if category is edited. Does not flush the message list. + * + * @param aVideo Video which was changed. + * @param aModified Set to ETrue if categories were modified. + */ + void UpdateCategoryNewVideoNameAndDateL( CMPXMedia& aVideo, TBool& aModified ); + + /** + * Called when items New Video Flag is updated in iCollection.iCache. + * This function updates video counters only, no New Video Name. + * + * @param aOldFlags Items flags before update. + * @param aNewFlags Items flags after update. + * @param aOrigin Which origin is affected. + * @param aModified Set to ETrue if category counters were edited and events + * were added to message list. This does not flush the message list. + */ + void NewVideoFlagChangedL( TUint32 aOldFlags, TUint32 aNewFlags, + TUint8 aOrigin, TBool& aModified ); + + /** + * Checks in which categories the video belongs to and sends modified events for them. + * + * @param aVideo Video which was modified. + * @param aFlushMessageList If ETrue, then the collections message list is sent to clients. + * @param aExtraInfo Extra information about the event, this value is written to + * KVcxMediaMyVideosInt32Value attribute. If aExtraInfo + * is 0, nothing is written. + */ + void GenerateCategoryModifiedEventL( CMPXMedia& aVideo, TBool aFlushMessageList, + TInt32 aExtraInfo = 0 ); + + /** + * Called when videos origin is changed in iCollection.iCache. + * Updates category variables and sends necessarry events. + * + * @param aVideo Video which is changed, flags variable is read from here. + * @param aPrevOrigin Previous origin. + * @param aNewOrigin New origin. + */ + void OriginChangedL( CMPXMedia& aVideo, TUint8 aPrevOrigin, TUint8 aNewOrigin ); + + private: + /** + * Constructor + */ + CVcxMyVideosCategories( CVcxMyVideosCollectionPlugin& aCollectionPlugin ); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL (); + + /** + * Creates CMPXMedia object with category values and appends it to + * aCategoryArray. + * + * @param aTitle Category title. + * @param aId Collection item ID + * @param aCategoryArray New CMPXMedia category object is appended here. + */ + void AppendCategoryToArrayL( const TDesC& aTitle, TMPXItemId aId, + CMPXMediaArray& aCategoryArray ); + + /** + * Updates video counts in categories. + * + * @param aCategoryArray Category array, provided as function parameter since the + * calling function already has it available. + * @param aVideosIncrements How many new items were added to each category. + * @param aNewVideosIncrements How many videos with new flag were added to each category. + */ + void UpdateVideosCountL( CMPXMediaArray& aCategoryArray, + RArray& aVideosIncrements, RArray& aNewVideosIncrements ); + + /** + * Increases/decreases aCountAttribute in aCategory. Adds event to + * iCollection.iMessageList if category is modified. aEventInfo is written + * to event's extra info. Does not flush iCollection.iMessageList. + * + * @param aCategory Category being modified. + * @param aIncrement This is added to category's current attribute value. + * @param aCountAttribute Attribute ID. + * @param aEventInfo This is written to generated event's extra info attribute. + * + */ + void UpdateVideosCountL( CMPXMedia& aCategory, TInt aIncrement, + TMPXAttributeData aCountAttribute, TInt aEventInfo ); + + /** + * aVideo is added(or removed) to aCategory. Updates category variables accordingly. + * + * @param aCategory Category + * @param aCategoryIndex Category index in iList + * @param aAdded ETrue if aVideo was added to iList, EFalse if being removedo. + */ + void UpdateCategoryL( CMPXMedia& aCategory, TInt aCategoryIndex, + CMPXMedia& aVideo, TBool aAdded ); + + /** + * Adds aAddition to aAttribute in aCategory. + * + * @param aCategory Category to modify. + * @param aAddition How much increase/decrease the attribute. + * @param aAttribute Which attribute to modify. + */ + void AddToTUint32AttributeL( CMPXMedia& aCategory, TInt aAddition, + TMPXAttributeData aAttribute ); + + /** + * Returns the corresponding category index in category list (=iList) for aOrigin. + * Notice that category index is the same as categorys MPXIDs iId1 value. + * They should be kept the same. + * + * @param aOrigin Origin, see values from TVcxMyVideosOrigin, if -1 given, then + * index for All category is returned. + * @return Index in category list (=iList) + */ + TInt CategoryIndex( TInt aOrigin ); + + /** + * Updates categorys New Video Name and Creation date fields. Sets aModified to + * ETrue if value is changed, also adds modify event to event list, + * but does not send it. + * + * @param aOrigin Identifies the category, -1 is used for All category. + * @param aModified Set to ETrue if category item is modified. Otherwise + * the value is not touched. + * @param aIgnoredIds Items with these MDS ids are ignored on the update. + * Usefull if items are being deleted but are still on the + * video list. + */ + void UpdateCategoryNewVideoNameAndDateL( TInt aOrigin, TBool& aModified, + RArray& aIgnoredIds ); + + /** + * Goes through aVideoList and checks all videos which have new video + * flag set and returns the latest ones name. Pointer to latest video + * object is written to aNewVideo. + * + * @param aVideoList Video list + * @param aOrigin Can be used to filter search. Only items which have + * matching origin are included to the operation. + * If -1, then all items are included. + * @param aIgnoredIds Items with these MDS ids are ignored on the update. + * Usefull if items are being deleted but are still on the + * video list. + * @param aNewVideo Pointer to media object containing the new video name is + * written here. NULL is written if not found. Ownership + * does not move (stays in aVideoList). + * + */ + const TDesC& CalculateNewVideoNameL( CMPXMedia& aVideoList, TInt aOrigin, + RArray& aIgnoredIds, CMPXMedia*& aNewVideo ); + + /** + * Video was added or is being removed in iCollection.iCache. Update + * Categories accordingly. + * + * @param aMdsId Item which was added or removed. + * @param aAdded ETrue if add operation, EFalse if remove. + */ + void VideoAddedOrRemovedL( TUint32 aMdsId, TBool aAdded ); + + /** + * Video was added or is being removed in iCollection.iCache. Update + * Categories accordingly. + * + * @param aVideo Item which was added or removed. + * @param aAdded ETrue if add operation, EFalse if remove. + */ + void VideoAddedOrRemovedL( CMPXMedia& aVideo, TBool aAdded ); + + /** + * Videos were added or are being removed in iCollection.iCache. Update + * Categories accordingly. + * + * @param aIds Items which were added or are being removed. + * @param aAdded ETrue if add operation, EFalse if remove. + */ + void VideosAddedOrRemovedL( RArray& aIds, TBool aAdded ); + + /** + * Resets iModifiedCategories + */ + void ResetModifiedCategoriesArray(); + + /** + * Creates events from iModifiedCategories and adds them + * to iCollection.iMessageList. Does not send. + */ + void AddEventsFromModifiedCategoriesArrayL(); + + public: + + /** + * Contains category list, this is kept in memory to speed things up. + * Own. + */ + CMPXMedia* iList; + + /** + * Media array of iList, owned by iList. + */ + CMPXMediaArray* iListArray; + + private: + + /** + * Owner of this object. + */ + CVcxMyVideosCollectionPlugin& iCollection; + + /** + * Array containing boolean for each category, if set ETrue, then modified event + * has been added for the category (to iCollection.iMessageList). + */ + RArray iModifiedCategories; + + public: // Friend classes + + friend class CCollectionPluginTest; + }; + +#endif // VCXMYVIDEOSCATEGORIES_H + + diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideoscollectionutil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideoscollectionutil.h Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,315 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +#ifndef VCXMYVIDEOSCOLLECTIONUTIL_H +#define VCXMYVIDEOSCOLLECTIONUTIL_H + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CMPXMedia; +class RFs; + +// CONSTANTS + +// CLASS DECLARATION + +/** +* Util functions. +* +* @lib mpxmyvideoscollectionplugin.lib +*/ +NONSHARABLE_CLASS(TVcxMyVideosCollectionUtil) + { + public: + + /** + * Creates media container and sets up empty media array to it. + * + * @return CMPXMedia media list. + */ + static CMPXMedia* CreateEmptyMediaListL(); + + /** + * Creates message list and sets up empty message array to it. + * + * @return CMPXMessage message list. + */ + static CMPXMedia* CreateEmptyMessageListL(); + + /** + * Tries to find aMdsIds from aFromList and if found, copies them + * to aToList. KMPXMediaArrayContents arrays must be set for aFromList + * and aToList, othewise leave (KErrArgument) occurs. + * + * @param aFromList Items are copied from here. + * @param aToList Items are copied here. + * @param aMdsIds Item IDs which are copied. + */ + static void CopyFromListToListL( + CMPXMedia& aFromList, + CMPXMedia& aToList, + RArray& aMdsIds ); + + /** + * Tries to find aMdsIds from aFromArray and if found, copies them + * to aToList. KMPXMediaArrayContents arrays must be set for aToList, + * othewise leave (KErrArgument) occurs. + * + * @param aFromArray Items are copied from here. + * @param aToList Items are copied here. + * @param aMdsIds Item IDs which are copied. + */ + static void CopyFromListToListL( + RArray& aFromArray, + CMPXMedia& aToList, + RArray& aMdsIds ); + + /** + * Appends all items from aFromList to aToList. New items will point to + * same shared memory. + * + * @param aToList List in which items are appended to. + * @param aFromList List in which items are copied from. + */ + static void AppendToListL( CMPXMedia& aToList, CMPXMedia& aFromList ); + + /** + * Converts drive letter to drive number. + * + * @param aDrive drive letter + * @return drive number + */ + static TInt DriveLetter2DriveNumber( const TDesC &aDrive ); + + /** + * Checks that file system does not have aPath file already, if it does + * then the aPath is changed to unique by adding digits to it. Result + * is stored to aUniquePath, (event if it is the same as aPath). + * + * @param aFs Open session to file server. + * @param aPath File name to make unique. + * @param aUniquePath Generated unique path. + */ + static void MakeUniqueFileNameL( RFs& aFs, const TDesC& aPath, TDes& aUniquePath ); + + /** + * Gets KVcxMediaMyVideosOrigin attribute of aVideo. + * + * @param aVideo Media object to fetch parameter from. + * @return Origin, see values from TVcxMyVideosOrigin in vcxmyvideosdefs.h + */ + static TUint8 OriginL( CMPXMedia& aVideo ); + + /** + * Gets KMPXMediaGeneralFlags attribute of aVideo. + * + * @param aVideo Media object to fetch parameter from. + * @return Flags, see values from TVcxMyVideosVideoFlags in vcxmyvideosdefs.h + */ + static TUint32 FlagsL( CMPXMedia& aVideo ); + + /** + * Gets KMPXMediaGeneralDate (creation date) of aVideo. + * + * @param aVideo Media object to fetch parameter from. + * @return Creation date, works with TTime. + */ + static TInt64 CreationDateL( CMPXMedia& aVideo ); + + /** + * Gets KVcxMediaMyVideosDownloadId attribute of aVideo. + * + * @param aVideo Media object to fetch parameter from. + * @return Download ID in Download Manager. + */ + static TUint32 DownloadIdL( CMPXMedia& aVideo ); + + /** + * Gets KVcxMediaMyVideosDownloadState attribute of aVideo. + * + * @param aVideo Media object to fetch parameter from. + * @return Download state. + */ + static TVcxMyVideosDownloadState DownloadStateL( CMPXMedia& aVideo ); + + /** + * Gets KMPXMediaGeneralId attribute of aVideo. + * + * @param aVideo Media object to fetch parameter from. + * @return ID. + */ + static TMPXItemId IdL( const CMPXMedia& aVideo ); + + /** + * Gets KVcxMediaMyVideosDuration attribute of aVideo. + * + * @param aVideo Media object to fetch parameter from. + * @return Duration. + */ + static TReal32 DurationL( CMPXMedia& aVideo ); + + /** + * Gets KMPXMediaGeneralTitle attribute of the video. + * + * @return KMPXMediaGeneralTitle value. If attribute is not supported, + * then KNullDesC is returned. + */ + static const TDesC& Title( const CMPXMedia& aVideo ); + + /** + * Gets KVcxMediaMyVideosRating attribute of the video. + * + * @param aVideo Media object to fetch parameter from. + * @return KVcxMediaMyVideosRating value. If attribute is not supported, + * then 0 is returned. + */ + static TUint8 RatingL( CMPXMedia& aVideo ); + + /** + * Gets KVcxMediaMyAudioFourCc attribute of the video. + * + * @param aVideo Media object to fetch parameter from. + * @return KVcxMediaMyAudioFourCc value. If attribute is not supported, + * then 0 is returned. + */ + static TUint32 AudioFourCcL( CMPXMedia& aVideo ); + + /** + * Checks if aAttrs contains attributes which are not supported in aVideo. + * + * @param aVideo Attributes to check from. + * @param aAttrs Attributes to check. + * @param aNonSupportedAttrCanBeFoundFromMds Set to ETrue if at least one of non supported + * attributes can be found from MDS. + * @return ETrue if all aAttrs attributes are supported in aVideo, EFalse + * otherwise. + */ + static TBool AreSupported( CMPXMedia& aVideo, const TArray& aAttrs, + TBool& aNonSupportedAttrCanBeFoundFromMds ); + + /** + * Checks if aAttrs belongs to "full" set of parameters which is saved to MDS but not + * cached by collection. + * + * @param aAttr Attribute to check. + * @return ETrue if aAttr belongs to full set and can be found from MDS, EFalse + * otherwise. + */ + static TBool AttrBelongsToFullSet( const TMPXAttribute& aAttr ); + + /** + * Converts collection category ID to origin. + * + * @param aCategoryId Category ID + * @return Returns Origin or KErrNotFound if not found. KVcxMvcCategoryIdAll + * returns also KErrNotFound. + */ + static TInt Origin( TInt aCategoryId ); + + /** + * Gets KMPXMediaArrayContents attribute from aMedia. Leaves + * with KErrArgument is attribute is not supported. + * + * @param aMedia Media where from the attribute is fetched. + * @return Pointer to media array. + */ + static CMPXMediaArray* MediaArrayL( const CMPXMedia& aMedia ); + + /** + * Gets KVcxMediaMyVideosInt32Value attribute from aMedia. Leaves + * with KErrArgument if attribute is not supported. + * + * @param aMedia Media where from the attribute is fetched. + * @return Value of KVcxMediaMyVideosInt32Value attribute. + */ + static TInt32 Int32ValueL( CMPXMedia& aMedia ); + + /** + * Gets KVcxMediaMyVideosUint32Value attribute from aMedia. Leaves + * with KErrArgument if attribute is not supported. + * + * @param aMedia Media where from the attribute is fetched. + * @return Value of KVcxMediaMyVideosUint32Value attribute. + */ + static TUint32 Uint32ValueL( CMPXMedia& aMedia ); + + /** + * Gets KVcxMediaMyVideosCategoryItemCount attribute from aVideo. + * + * @param aMedia Media where from the attribute is fetched. + * @return Returns 0, if attribute is not supported. + */ + static TUint32 CategoryItemCountL( CMPXMedia& aVideo ); + + /** + * Gets KVcxMediaMyVideosCategoryNewItemCount attribute from aVideo. + * + * @param aMedia Media where from the attribute is fetched. + * @return Returns 0, if attribute is not supported. + */ + static TUint32 CategoryNewItemCountL( CMPXMedia& aVideo ); + + /** + * Gets KVcxMediaMyVideosCategoryNewItemName attribute from aVideo. + * + * @param aMedia Media where from the attribute is fetched. + * @return Category new video name. + */ + static const TDesC& CategoryNewVideoName( const CMPXMedia& aVideo ); + + /** + * Gets KMPXMediaGeneralId attributes from aMediaArray and + * puts them to aIdArray. aIdArray is reset before adding. + * + * @param aMediaArray Media array containing media items which + * have KMPXMediaGeneralId attribute set. + * @param aIdArray Array where to the IDs are written to. + */ + static void GetIdsFromMediaArrayL( CMPXMediaArray& aMediaArray, + RArray& aIdArray ); + +#ifdef _DEBUG + /** + * Prints process names which have file handle open to aFileName + * + * @param aFileName File to check for open file handles. + */ + static void PrintOpenFileHandlesL( const TDesC& aFileName, RFs& aFs ); + + /** + * Gets process name. + * + * @param aThreadId Thread ID + * @param aProcessName Upon completion process name is written here. + */ + static void GetProcessName( TInt aThreadId, TFullName& aProcessName ); + + private: + TBuf<500> iProcessName; +#endif + + public: // Friend classes + + friend class CCollectionPluginTest; + }; +#endif // VCXMYVIDEOSCOLLECTIONUTIL_H + + diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosmdsalbums.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosmdsalbums.h Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,528 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Provides albums support from MDS* +*/ + + + +#ifndef VCXMYVIDEOSMDSALBUMS_H +#define VCXMYVIDEOSMDSALBUMS_H + +// INCLUDES +#include +#include +#include "vcxmyvideosalbum.h" +#include "vcxmyvideosmdsdb.h" + +// FORWARD DECLARATIONS +class CMPXMedia; + +// CONSTANTS + +// CLASS DECLARATION + +/** +* Provides albums support, uses MDS. +* +* @lib mpxmyvideoscollectionplugin.lib +*/ +NONSHARABLE_CLASS(CVcxMyVideosMdsAlbums) : + public CActive, + public MMdEQueryObserver, + public MMdERelationItemObserver +#if 0 + , + public MMdERelationObserver +#endif + { + public: // Constructors and destructor + + friend class CVcxMyVideosMdsCmdQueue; + friend class CVcxMyVideosMdsDb; + + enum TVcxAsyncOperation + { + EVcxNone, + EVcxAddVideosToAlbum, + EVcxRemoveRelations, + EVcxRemoveAlbums + }; + + /** + * Constructor. + * + * @param aMdsDb Owner of this object. + * @param aObserver Object which is listening album related events. If NULL, then + * no observer is set. + */ + static CVcxMyVideosMdsAlbums* NewL( CVcxMyVideosMdsDb& aMdsDb, + MVcxMyVideosMdsAlbumsObserver* aObserver ); + + /** + * Destructor + */ + virtual ~CVcxMyVideosMdsAlbums(); + + public: // new methods + + /** + * From CActive. + * Cancels possible ongoing asynchronous request. + * + * @param aType Defines what kind of request is cancelled. + */ + void DoCancel( CVcxMyVideosMdsDb::TRequestType aType = CVcxMyVideosMdsDb::EAll ); + + /** + * Cancels queries. + * + * @param aType Defines what kind of request is cancelled. + */ + void CancelQueries( CVcxMyVideosMdsDb::TRequestType aType = CVcxMyVideosMdsDb::EAll ); + + /** + * Gets My Videos albums from MDS asynchronously. + * HandleGetAlbumsResp() callback function is called when ready. + * Utilizes CVcxMyVideosMdsCmdQueue. + * + * @param aAlbumList Album list is written here. Caller owns this, ownership + * does not move. + * @param aClient Response call is done to this object. + */ + void GetAlbumsL( CMPXMedia* aAlbumList, MVcxMyVideosMdsAlbumsObserver& aClient ); + + /** + * Gets album from MDS synchronously. + * + * @param aId MDS ID of the album to be fetched. + * @returm MPX media containing album data. Ownership + * moves to caller. NULL if not found. + */ + CMPXMedia* GetAlbumL( TUint32 aId ); + + /** + * Gets album content IDs asynchronously. + * HandleGetAlbumContentIdsResp() callback function is called when ready. + * Utilizes CVcxMyVideosMdsCmdQueue. + * + * @param aAlbumId Album ID. + * @param aContentArray Item IDs which belog to aAlbum are written here. Caller must + * keep aContentArray available until HandleGetAlbumContentIdsResp + * has been called. + * @param aClient Response call is done to this object. + */ + void GetAlbumContentIdsL( TUint32 aAlbumId, RArray& aContentArray, + MVcxMyVideosMdsAlbumsObserver& aClient ); + + /** + * Gets album content videos asynchronously. + * HandleGetAlbumContentVideosResp() callback function is called when ready. + * Utilizes CVcxMyVideosMdsCmdQueue. + * + * @param aAlbumId Album ID. + * @param aVideoList Media containing media array. Video media objects are added to media array. + * Caller must keep aVideoList available until callback has been called. + * @param aClient Response call is done to this object. + */ + void GetAlbumContentVideosL( TUint32 aAlbumId, CMPXMedia& aVideoList, + MVcxMyVideosMdsAlbumsObserver& aClient ); + + /** + * Adds videos to album asynchronously. HandleAddVideosToAlbumResp() callback function + * is called when operation finishes. + * Utilizes CVcxMyVideosMdsCmdQueue. + * + * @param aMpxCmd Media containing command parameters: album ID and video ID list. + * Results are also written to this object. See media structure and + * used attributes from vcxmyvideosdef.c file, + * KVcxCommandMyVideosAddToAlbum command. Ownership does not move. + * + * @param aClient Response call is done to this object. + */ + void AddVideosToAlbumL( CMPXMedia* aMpxCmd, MVcxMyVideosMdsAlbumsObserver& aClient ); + + /** + * Removes relations asynchronously. + * Utilizes CVcxMyVideosMdsCmdQueue. + * + * @param aRelationIds Relations which are removed. + * @param aResults In sync with aRelationIds. Result codes, KErrNone if successful, + * KErrGeneral if failed. + * @param aClient Response call is done to this object. + */ + void RemoveRelationsL( RArray& aRelationIds, + RArray& aResults, MVcxMyVideosMdsAlbumsObserver& aClient ); + + /** + * Adds album to MDS. aAlbum should have KMPXMediaGeneralTitle attribute + * set. The MDS item ID of the created album is written to KMPXMediaGeneralId + * attribute. + * + * @param aAlbum Album which is added to database. + */ + void AddAlbumL( CMPXMedia& aAlbum ); + + /** + * Removes albums asynchronously. HandleRemoveAlbumsResp() callback function + * is called when operation finishes. + * Utilizes CVcxMyVideosMdsCmdQueue. + * + * @param aMpxCmd Media containing command parameters: media array containing album IDs. + * Results are also written to this object. See media structure and + * used attributes from vcxmyvideosdef.c file, + * KVcxCommandMyVideosRemoveAlbums command. Ownership does not move. + * + * @param aClient Response call is done to this object. + */ + void RemoveAlbumsL( CMPXMedia* aMpxCmd, MVcxMyVideosMdsAlbumsObserver& aClient ); + + /** + * Sets album attributes. + * + * @param aVideo Values from aVideo are written to MDS. + */ + void SetAlbumL( CMPXMedia& aVideo ); + + protected: + + /** + * From CActive. + * Called when operation completes. + */ + void RunL(); + + /** + * From CActive. + * Actual implementation for cancelling. + */ + void DoCancel(); + + private: + + /** + * Constructor + */ + CVcxMyVideosMdsAlbums( CVcxMyVideosMdsDb& aMdsDb, + MVcxMyVideosMdsAlbumsObserver* aObserver ); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL(); + + /** + * Copies album data from aObject to aAlbum. + * + * @param aObject MDS object to copy data from. + * @param aAlbum MPX media to copy data to. + */ + void Object2MediaL( CMdEObject& aObject, CMPXMedia& aAlbum ); + + /** + * Copies album data from aAlbum to aObject. + * + * @param aAlbum MPX media to copy data from. + * @param aObject MDS object to copy data to. + */ + void Media2ObjectL( CMPXMedia& aAlbum, CMdEObject& aObject); + + /** + * Gets various defintions from MDS and stores them to member variables. + */ + void GetSchemaDefinitionsL(); + + /** + * Gets My Videos albums from MDS asynchronously. + * HandleGetAlbumsResp() callback function is called when ready. + * + * @param aAlbumList Album list is written here. Caller owns this, ownership + * does not move. + * @param aClient Callback is done to this object. + */ + void DoGetAlbumsL( CMPXMedia* aAlbumList, MVcxMyVideosMdsAlbumsObserver& aClient ); + + /** + * Gets album content IDs from MDS asynchronously. + * HandleGetAlbumContentIdsResp() callback function is called when ready. + * + * @param aAlbumId Album ID. + * @param aContentArray Array containing MDS IDs which belong to aAlbum. + * Caller is responsible to keep array available + * until HandleGetAlbumContentResp has been called. + * @param aClient Callback is done to this object. + */ + void DoGetAlbumContentIdsL( TUint32 aAlbumId, + RArray& aContentArray, + MVcxMyVideosMdsAlbumsObserver& aClient ); + + /** + * Gets album content videos from MDS asynchronously. + * HandleGetAlbumContentVideosResp() callback function is called when ready. + * + * @param aAlbumId Album ID. + * @param aVideoList Media containing empty media array. Videos are added to array. Caller + * must keep aVideoList available until HandleGetAlbumContentVideosResp + * is called. + * @param aClient Callback is done to this object. + */ + void DoGetAlbumContentVideosL( TUint32 aAlbumId, CMPXMedia& aVideoList, + MVcxMyVideosMdsAlbumsObserver& aClient ); + + /** + * Adds videos to album asynchronously. HandleAddVideosToAlbumResp() callback function + * is called when operation finishes. + * + * @param aMpxCmd Media containing command parameters: album ID and video ID list. + * Results are also written to this object. See media structure and + * used attributes from vcxmyvideosdef.c file, + * KVcxCommandMyVideosAddToAlbum command. Ownership does not move. + * @param aClient Response call is done to this object. + */ + void DoAddVideosToAlbumL( CMPXMedia* aMpxCmd, MVcxMyVideosMdsAlbumsObserver& aClient ); + + /** + * Removes relations asynchronously. + * + * @param aRelationIds Relations which are removed. + * @param aResults In sync with aRelationIds. Result codes, KErrNone if successful, + * KErrGeneral if failed. + * @param aClient Response call is done to this object. + */ + void DoRemoveRelationsL( RArray& aRelationIds, + RArray& aResults, MVcxMyVideosMdsAlbumsObserver& aClient ); + + /** + * Removes albums asynchronously. + * + * @param aMpxCmd Media containing command parameters: array with albums IDs. + * @param aClient Response call is done to this object. + */ + void DoRemoveAlbumsL( CMPXMedia* aMpxCmd, + MVcxMyVideosMdsAlbumsObserver& aClient ); + + /** + * Handles album query responses. + * + * @param aQuery Query instance. + * @param aError KErrNone, if the query was completed + * successfully. Otherwise one of the system-wide error + * codes. + */ + void HandleAlbumQueryCompletedL(CMdEQuery& aQuery, TInt aError); + + /** + * Handles video query responses. + * + * @param aQuery Query instance. + * @param aError KErrNone, if the query was completed + * successfully. Otherwise one of the system-wide error + * codes. + * @param aFirstNewItemIndex Index of the first new item in the query. + * @param aNewItemCount How many new items were added. + * @param aComplete ETrue if query is complete, EFalse if new to come. + */ + void HandleVideoQueryResultsL( CMdEQuery& aQuery, TInt aError, + TInt aFirstNewItemIndex, TInt aNewItemCount, TBool aComplete ); + + /** + * Handles relation query responses. + * + * @param aQuery Query instance. + * @param aError KErrNone, if the query was completed + * successfully. Otherwise one of the system-wide error + * codes. + */ + void HandleRelationQueryCompletedL( CMdEQuery& aQuery, TInt aError ); + + /** + * Called from RunL when video adding to album completes. + */ + void HandleAddVideosToAlbumCompletedL(); + + /** + * Called from RunL when relations remove completes. + */ + void HandleRemoveRelationsCompletedL(); + + /** + * Called from RunL when albums remove completes. + */ + void HandleRemoveAlbumsCompletedL(); + + /** + * Registers observing to MDS session. + */ + void SetObservingL(); + + protected: + + /** + * From MMdEQueryObserver. + * Called to notify the observer that new results have been received + * in the query. + * + * @param aQuery Query instance that received new results. + * @param aFirstNewItemIndex Index of the first new item that was added + * to the result item array. + * @param aNewItemCount Number of items added to the result item + * array. + */ + void HandleQueryNewResults(CMdEQuery& aQuery, + TInt aFirstNewItemIndex, + TInt aNewItemCount); + + /** + * From MMdEQueryObserver. + * Called to notify the observer that the query has been completed, + * or that an error has occured. + * + * @param aQuery Query instance. + * @param aError KErrNone, if the query was completed + * successfully. Otherwise one of the system-wide error + * codes. + */ + void HandleQueryCompleted(CMdEQuery& aQuery, TInt aError); + + /** + * From MMdERelationItemObserver + */ + void HandleRelationItemNotification(CMdESession& aSession, + TObserverNotificationType aType, + const RArray& aRelationArray); + + /** + * From MMdERelationObserver + */ + void HandleRelationNotification(CMdESession& aSession, + TObserverNotificationType aType, + const RArray& aRelationIdArray); + + private: + + /** + * Main class for Mds operations. Owns session to MDS. + */ + CVcxMyVideosMdsDb& iMdsDb; + + /** + * Observer of albums related events. May be NULL. + * not own. + */ + MVcxMyVideosMdsAlbumsObserver* iObserver; + + /** + * Asynchronous album object fetching query is stored here. Own. + */ + CMdEObjectQuery* iAlbumQuery; + + /** + * Asynchronous video object fetching query is stored here. Own. + */ + CMdEObjectQuery* iVideoQuery; + + /** + * Asynchronous relation fetching query is stored here. Own. + */ + CMdERelationQuery* iRelationQuery; + + /** + * The default namespace definition, not own. + */ + CMdENamespaceDef* iNamespaceDef; + + /** + * Album object definition, not own. + */ + CMdEObjectDef* iAlbumObjectDef; + + /** + * Album type property definition, not own. + */ + CMdEPropertyDef* iTypePropertyDef; + + /** + * "Contains" relation definition, not own. + */ + CMdERelationDef* iContainsRelationDef; + + /** + * Pointer to album list which is being fetched from MDS. Not own. + */ + CMPXMedia* iAlbumList; + + /** + * Pointer to video list which is being fetched from MDS. Not own. + */ + CMPXMedia* iVideoList; + + /** + * When doing some async operation to MDS, the album ID is stored here. + */ + TUint32 iAlbumId; + + /** + * When fetching album content from MDS, the pointer to content array is stored here. + * Only MDS ID is filled to TVideo. + * Not own. + */ + RArray* iAlbumContent; + + /** + * The pending async operation ID is stored here. + */ + TVcxAsyncOperation iAsyncOperation; + + /** + * Used for storing items during async mds operations. + */ + RPointerArray iItemArray; + + /** + * Used for storing result buffer during async mds operations. + */ + RMdEDataBuffer iResultBuffer; + + /** + * Used in async operations to store + * pointer to result array (which is owned by the user). + */ + RArray* iResultArray; + + /** + * Used in async operations to store + * pointer to result array (which is owned by the user). + */ + RArray* iResultArrayUint32; + + /** + * Used in async oprations (EVcxAddVideosToAlbum and EVcxRemoveVideosFromAlbum) to store + * pointer to item ID array (which is owned by the user). + */ + RArray* iIdArray; + + /** + * Used to store command parameters during async MDS operations. Not owned. + */ + CMPXMedia* iMpxCmd; + + /** + * Used to store pointer to client who initiated the async operation. + */ + MVcxMyVideosMdsAlbumsObserver* iClient; + + }; + +#endif // VCXMYVIDEOSMDSALBUMS_H + + diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosmdsdb_stub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosmdsdb_stub.h Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,807 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MPX My Videos collection plugins' MDS database class* +*/ + + + +#ifndef VCXMYVIDEOSMDSDB_H +#define VCXMYVIDEOSMDSDB_H + + +#include +#include +#include +#include +#include +#include +#include "vcxmyvideosalbum.h" +#include + +class CVcxMyVideosMdsAlbums; +class CMPXMedia; +class CVcxMyVideosMdsCmdQueue; + +const TUid KHarvesterPSShutdown = { 0x200009F5 } ; +const TInt KMdSShutdown = 0x00000002; // values 1 = shutdown, 0 = restart, normal state + +static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy); +static _LIT_SECURITY_POLICY_C1(KPowerMgmtPolicy,ECapabilityPowerMgmt); + +/** + * MPX My Videos collection MDS database observer class. + * Part of ECOM Plugin. + */ +NONSHARABLE_CLASS(MVcxMyVideosMdsDbObserver) + { + public: + + /* + + Defined in mpxcollectionmessagedefs.h: + + enum TMPXChangeEventType + { + EMPXItemDeleted, // item/playlist deleted + EMPXItemInserted, // item/playlist added + EMPXItemModified // item/playlist/artist/album/genre/composer modified + }; + */ + + /** + * Handler function for database events. + * + * @param aEvent Event type. + * @param aId Array of IDs in database. + * @param aEventsLeft How many events are still coming. + */ + virtual void HandleMyVideosDbEvent( TMPXChangeEventType aEvent, RArray& aId, TInt aEventsLeft ) = 0; + + /** + * Handler function for video list fetching events. This callback is called as a response + * to CreateVideoList( aSync = EFalse ). + * + * @param aVideoList List of videos fetched from MDS. + * @param aNewItemsStartIndex Start position for the new items added. If -1, then no new + * items were added. + * @param aComplete ETrue if list is complete and no more items are expected, + * EFalse if there are more to come. + */ + virtual void HandleCreateVideoListResp( CMPXMedia* aVideoList, + TInt aNewItemsStartIndex, TBool aComplete ) = 0; + + /** + * Handler function for media remove/insert events. This is called every time + * media is removed or inserted (objects become present or non present). + */ + virtual void HandleObjectPresentNotification() = 0; + }; + + +/** + * MPX My Videos collection MDS albums related functionality observer class. + * Part of ECOM Plugin. + */ +NONSHARABLE_CLASS(MVcxMyVideosMdsAlbumsObserver) + { + public: + + /** + * This callback is called as a response to GetAlbumsL. + * + * @param aAlbumList List of albums fetched from MDS. + */ + virtual void HandleGetAlbumsResp( CMPXMedia* aAlbumList ) = 0; + + /** + * This callback is called as a response to GetAlbumContentIdsL. + * + * @param aAlbumId Album ID which was fetched. + * @param aContentArray Array containing MDS object IDs. This array is the same which + * was given in GetAlbumContentIdsL call. + */ + virtual void HandleGetAlbumContentIdsResp( TUint32 aAlbumId, + RArray& aContentArray ) = 0; + + /** + * 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. + */ + virtual void HandleGetAlbumContentVideosResp( TUint32 aAlbumId, CMPXMedia& aVideoList, + TInt aError, TInt aFirstNewItemIndex, TInt aNewItemCount, TBool aComplete ) = 0; + + /** + * Called as a response to AddVideosToAlbumL. Results are written from aItemArray + * to aCmd (KVcxMediaMyVideosInt32Value attribute). KErrNone if operation was successful, + * KErrGeneral otherwise. + * + * @param aCmd Pointer to same object which was given in AddVideosToAlbumL function call. + * @param aItemArray Array of relation items that were added to MDS. + */ + virtual void HandleAddVideosToAlbumResp( CMPXMedia* aCmd, + RPointerArray& aItemArray ) = 0; + + /** + * Called as a response to RemoveRelationsL. + * + * @param aRelationIds Relations which were tried to be removed. + * @param aResults Result codes, in sync with aRelationIds. KErrNone if successful, + * KErrGeneral if failed. + */ + virtual void HandleRemoveRelationsResp( RArray& aRelationIds, + RArray& aResults ) = 0; + + /** + * Called as a response to RemoveAlbumsL. + * + * @param aCmd Cmd which was given in RemoveAlbumsL call. + * @param aResults Result IDs. + */ + virtual void HandleRemoveAlbumsResp( CMPXMedia* aCmd, + RArray& aResultIds ) = 0; + + /** + * Event handler function for relation delete events. + * + * @param aType Event type + * @param aRelationArray Array containing relations. + */ + virtual void HandleRelationEvent( TObserverNotificationType aType, + const RArray& aRelationArray ) = 0; + +#if 0 + /** + * Event handler function for relation add events. + * + * @param aType Event type + * @param aRelationArray Array containing relations. + */ + virtual void HandleRelationIdEvent( TObserverNotificationType aType, + const RArray& aRelationIdArray ) = 0; +#endif + + }; + +/** + * PSCW Listener Observer interface for signaling that MDS has Shutdown/restarted + */ +class MVcxMdsShutdownMonitorObserver + { +public: + + virtual void ShutdownNotification( TInt aShutdownState ) = 0; + }; + +/** + * Active object for observing P&S keys + */ +class CVcxMdsShutdownMonitor: public CActive + { +public: + + /** + * Two-phased constructor. + * + * @return Instance of CVcxMdsShutdownMonitor. + */ + static CVcxMdsShutdownMonitor* NewL( MVcxMdsShutdownMonitorObserver& aObserver, + const TUid& aKeyCategory, const TInt aPropertyKey, TBool aDefineKey); + + /** + * Destructor + */ + virtual ~CVcxMdsShutdownMonitor(); + +protected: + + /** + * Handles an active object's request completion event. + */ + void RunL(); + + /** + * Implements cancellation of an outstanding request. + */ + void DoCancel(); + +private: + + /** + * C++ default constructor + * + * @return Instance of CVcxMdsShutdownMonitor. + */ + CVcxMdsShutdownMonitor( MVcxMdsShutdownMonitorObserver& aObserver, + const TUid& aKeyCategory, const TInt iPropertyKey, TBool aDefineKey ); + + /** + * Symbian 2nd phase constructor can leave. + */ + void ConstructL(); + +private: + + // not own + MVcxMdsShutdownMonitorObserver& iObserver; + + const TUid& iKeyCategory; + RProperty iProperty; + TInt iPropertyKey; + + TBool iDefineKey; +}; + +/** + * MPX My Videos collection ECOM plugin's MDS database class. + */ +NONSHARABLE_CLASS(CVcxMyVideosMdsDb) : + public CBase, + public MMdESessionObserver, + public MMdEQueryObserver, + public MMdEObjectObserver, + public MMdEObjectPresentObserver, + public MVcxMdsShutdownMonitorObserver + { + +public: + + friend class CVcxMyVideosMdsAlbums; + friend class CVcxMyVideosMdsCmdQueue; + + enum TRequestType + { + EAll, + EGetVideoList, + EGetAlbums, + EGetAlbumContentIds, + EGetAlbumContentVideos, + EAddVideosToAlbum, + ERemoveRelations, + ERemoveAlbums + }; + + class TEvent + { + public: + + TUint32 iMdsId; + TInt iEventType; + }; + + /** + * Two-phased constructor. + * @param aObserver The db change observer. + */ + static CVcxMyVideosMdsDb* NewL( MVcxMyVideosMdsDbObserver* aObserver, + RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver = NULL ); + + /** + * Two-phased constructor. + * @param aObserver The db change observer. + */ + static CVcxMyVideosMdsDb* NewLC( MVcxMyVideosMdsDbObserver* aObserver, + RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver = NULL ); + + + /** + * Destructor. + */ + virtual ~CVcxMyVideosMdsDb(); + + /** + * Cancels possible ongoing asynchronous operations. + * + * @param aType What kind of requests are cancelled. + */ + void Cancel( TRequestType aType = EAll ); + + /** + * Creates list of videos from MDS. This function utilizes CVcxMyVideosMdsQueue, ie + * commands are put in queue if there are other commands pending. + * + * @param aSortingOrder Sorting order, see values from TSortingOrder. + * @param aAscending Sort direction, if ETrue then ascending, else descending. + * @param aFullDetails If ETrue, then all details will be filled to media objects, + * if EFalse, then only subset. + * @param aVideoList Reference to pointer variable. Container type CMPXMedia class, contains + * CMPXMediaArray filled with CMPXMedia objects. If aVideoList + * pointer variable is NULL, then new medialist is created. + * If pointer variable already contains value, then the given medialist + * should have empty media array. New items are appended to it. + * Caller naturally owns the data. + * + */ + void CreateVideoListL( TVcxMyVideosSortingOrder aSortingOrder, + TBool aAscending, TBool aFullDetails, CMPXMedia*& aVideoList ); + + /** + * Add new video. + * + * @param aVideo Reference to CMPXMedia object. + * @param aMdsId New mds id is inserted to aMdsId + */ + void AddVideoL( CMPXMedia& aVideo, TUint32& aMdsId ); + + /** + * Remove video. + * + * @param aMdsId ID of the item to be removed. + * @return KErrNotFound if video was not found, KErrNone if found and deleted. + * If failed, system-wide error code. + */ + TInt RemoveVideo( TUint32 aMdsId ); + + /** + * Update video. + * + * @param aVideo Video to update in MDS database. + */ + void UpdateVideoL( CMPXMedia& aVideo ); + + /** + * Get one video item from MDS and create a new media + * object from it. + * + * @param aId Video identifier in MDS database. + * @param aFullDetails If ETrue, then all details are fetched, othewise only subset. + * @return Pointer to media object, ownership moves. NULL if + * not found. + */ + CMPXMedia* CreateVideoL( TUint32 aId, TBool aFullDetails = ETrue ); + + /** + * Called by iEventProcessor. + */ + static TInt ProcessEvents( TAny* aPtr ); + +protected: + +// from MMdESessionObserver + + /** + * Called to notify the observer that opening the session has been + * completed and, if the opening succeeded, the session is ready for use. + * + * @param aSession session + * @param aError KErrNone, if opening the session succeeded + * or one of the system-wide error codes, if opening the session failed + */ + void HandleSessionOpened(CMdESession& aSession, TInt aError); + + /** + * Called to notify the observer about errors, which are not a direct + * consequence of the operations initiated by the client but caused by some + * external source (e.g., other clients). The error cannot be recovered and + * all on-going operations initiated by the client have been aborted. + * Any attempts to continue using the session will cause a panic. The + * client should close the session immediately and try to open a new + * session if it needs to continue using the metadata engine. + * + * @param aSession session + * @param aError one of the system-wide error codes + */ + void HandleSessionError(CMdESession& aSession, TInt aError); + + +// from MMdEQueryObserver + + /** + * Called to notify the observer that new results have been received + * in the query. + * + * @param aQuery Query instance that received new results. + * @param aFirstNewItemIndex Index of the first new item that was added + * to the result item array. + * @param aNewItemCount Number of items added to the result item + * array. + */ + void HandleQueryNewResults(CMdEQuery& aQuery, + TInt aFirstNewItemIndex, + TInt aNewItemCount); + + /** + * Called to notify the observer that the query has been completed, + * or that an error has occured. + * + * @param aQuery Query instance. + * @param aError KErrNone, if the query was completed + * successfully. Otherwise one of the system-wide error + * codes. + */ + void HandleQueryCompleted(CMdEQuery& aQuery, TInt aError); + + +// from MMdEObjectObserver + + void HandleObjectNotification( CMdESession& aSession, + TObserverNotificationType aType, + const RArray& aObjectIdArray); + +// from MMdEObjectPresentObserver + void HandleObjectPresentNotification(CMdESession& aSession, + TBool aPresent, const RArray& aObjectIdArray); + +// from MVcxMdsShutdownMonitorObserver + void ShutdownNotification( TInt aShutdownState ); + +private: + + /** + * Constructor. + * @param aObserver The db change observer. + * @param aFs Session to file server. + */ + CVcxMyVideosMdsDb( MVcxMyVideosMdsDbObserver* aObserver, + RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver = NULL ); + + void ConstructL(); + + /** + * Gets object from MDS. + * + * @param aId The ID of the object to get. + * @param aIsVideo Set to ETrue if the object to be fetched is video. If set to + * EFalse, then the object is assumed to be album. + * @return The object if found, NULL otherwise. + */ + CMdEObject* ObjectL( const TItemId aId, TBool aIsVideo = ETrue ); + + /** + * Read the video details from the given object to the media class. + * + * @param aObject The object to read from. + * @param aVideo The media object to write to. + * @param aFullDetails If ETrue, then all parameters are copied, if + * EFalse, then only subset which is (usually) needed when + * showing videolist on UI. + */ + void Object2MediaL( + CMdEObject& aObject, + CMPXMedia& aVideo, + TBool aFullDetails = EFalse ); + + /** + * Fill the object from media. + * + * @param aMedia The media class to read from. + * @param aObject The object to modify. + */ + void Media2ObjectL( CMPXMedia& aVideo, CMdEObject& aObject ); + + /* + * Get the schema definitions needed. + */ + void GetSchemaDefinitionsL(); + + /** + * Handles MDS object changes. + * + * @param aType Type of the event. + * @param aObjectIdArray MDS IDs. + */ + void DoHandleObjectNotificationL( + TObserverNotificationType aType, + const RArray& aObjectIdArray ); + + /** + * Leaving version of HandleQueryNewResults. + * Called to notify the observer that new results have been received + * in the query. + * + * @param aQuery Query instance that received new results. + * @param aFirstNewItemIndex Index of the first new item that was added + * to the result item array. + * @param aNewItemCount Number of items added to the result item + * array. + */ + void DoHandleQueryNewResultsL(CMdEQuery& aQuery, + TInt aFirstNewItemIndex, TInt aNewItemCount); + + /** + * Creates list of videos from MDS. + * + * @param aSortingOrder Sorting order, see values from TSortingOrder. + * @param aAscending Sort direction, if ETrue then ascending, else descending. + * @param aFullDetails If ETrue, then all details will be filled to media objects, + * if EFalse, then only subset. + * @param aVideoList Reference to pointer variable. Container type CMPXMedia class, contains + * CMPXMediaArray filled with CMPXMedia objects. If aVideoList + * pointer variable is NULL, then new medialist is created. + * If pointer variable already contains value, then the given medialist + * should have empty media array. New items are appended to it. + * Caller naturally owns the data. + * + */ + void DoCreateVideoListL( TVcxMyVideosSortingOrder aSortingOrder, + TBool aAscending, TBool aFullDetails, CMPXMedia*& aVideoList ); + + /** + * Handles query complete events asynchronously. + */ + static TInt AsyncHandleQueryCompleted( TAny* aPtr ); + + /** + * Sets Creation Date and Modified properties to object. Uses current date + * value. + * + * @param aObject Object to modify. + */ + void SetCreationAndModifiedDatesL( CMdEObject& aObject ); + + /** + * Sets creation date to aObject from aVideo. + * + * @param aVideo Creation date is copied from here. + * @param aObject Creation date is written here. + */ + void SetCreationDateToObjectL( const CMPXMedia& aVideo, CMdEObject& aObject ); + + /** + * Opens MDS session. + */ + void OpenMdsSessionL(); + + /** + * @return MDS session. + */ + CMdESession& MdsSessionL(); + + /** + * Called by ProcessEvents. + */ + TInt DoProcessEvents(); + +public: + + /** + * Set to ETrue when starting to fetch media list from MDS. + * Set to EFalse when fetching is finished. + */ + TBool iVideoListFetchingIsOngoing; + + /** + * Album related functionality. + */ + CVcxMyVideosMdsAlbums* iAlbums; + +private: // data + + /** + * Command queue. Own. + */ + CVcxMyVideosMdsCmdQueue* iCmdQueue; + + /** + * The MDS session object. Own. + */ + CMdESession* iMdsSession; + + /** + * The sessions error state. + */ + TInt iMdsSessionError; + + /** + * Asynchronous video list fetching query is stored here. + */ + CMdEObjectQuery* iVideoQuery; + + /** + * Pointer to video list which is being fetched from the MDS. + * Not own. + */ + CMPXMedia* iVideoList; + + /** + * Requested detail level is stored here during the asynchronous video list fetching. + */ + TBool iFullDetails; + + /** + * The default namespace definition. Not own. + */ + CMdENamespaceDef* iNamespaceDef; + + /** + * The Video object definition. Not own. + */ + CMdEObjectDef* iVideoObjectDef; + + /** + * 2. + * The Title property definition. Not own. + */ + CMdEPropertyDef* iTitlePropertyDef; + + /** + * 3. + * The Description property definition. Not own. + */ + CMdEPropertyDef* iDescriptionPropertyDef; + + // 4. URI ( = file path ), set with SetUriL method + + /** + * 5. + * The Size property definition. Not own. + */ + CMdEPropertyDef* iSizePropertyDef; + + /** + * 6. + * The Creation Date property definition. Not own. + */ + CMdEPropertyDef* iCreationDatePropertyDef; + + /** + * Time offset from the universal time. Not own. + */ + CMdEPropertyDef* iTimeOffsetPropertyDef; + + /** + * 7. + * The Flags property definition. Not own. + */ + CMdEPropertyDef* iFlagsPropertyDef; + + /** + * 8. + * The Copyright property definition. Not own. + */ + CMdEPropertyDef* iCopyrightPropertyDef; + + /** + * 9. + * The Item Type property definition. Not own. + */ + CMdEPropertyDef* iItemTypePropertyDef; + + /** + * 10. + * The Modified Date property definition. Not own. + */ + CMdEPropertyDef* iLastModifiedDatePropertyDef; + + /** + * 11. + * The Age Profile property definition. Not own. + */ + CMdEPropertyDef* iAgeProfilePropertyDef; + + /** + * 12. + * The Audio Language property definition. Not own. + */ + CMdEPropertyDef* iAudioLanguagePropertyDef; + + /** + * 13. + * The Author property definition. Not own. + */ + CMdEPropertyDef* iAuthorPropertyDef; + + /** + * 14. + * The Origin property definition. Not own. + */ + CMdEPropertyDef* iOriginPropertyDef; + + /** + * 15. + * The Duration property definition. Not own. + */ + CMdEPropertyDef* iDurationPropertyDef; + + /** + * 16. + * The Last Play Point property definition. Not own. + */ + CMdEPropertyDef* iLastPlayPositionPropertyDef; + + /** + * 18. + * Rating property definition, not own. + */ + CMdEPropertyDef* iRatingPropertyDef; + + /** + * 19. + * Bitrate property definition, not own. + */ + CMdEPropertyDef* iBitratePropertyDef; + + /** + * DRM protection flag, not own. + */ + CMdEPropertyDef* iDrmPropertyDef; + + /** + * Not own. + */ + CMdEPropertyDef* iAudioFourCcPropertyDef; + + /** + * 22. + * Resolution Y-axis unit. Not own. + */ + CMdEPropertyDef* iWidthPropertyDef; + + /** + * 23. + * Resolution X-axis unit. Not own. + */ + CMdEPropertyDef* iHeightPropertyDef; + + /** + * 24. + * The artist property definition. Not own. + */ + CMdEPropertyDef* iArtistPropertyDef; + + /** + * Active scheduled waiter Own.. + */ + CActiveSchedulerWait* iActiveSchedulerWait; + + /** + * The file server session. + */ + RFs& iFs; + + /** + * The observer for db changes. Not own. + */ + MVcxMyVideosMdsDbObserver* iMdsDbObserver; + + /** + * The observer for albums related database events. Not own. + */ + MVcxMyVideosMdsAlbumsObserver* iAlbumsObserver; + + /** + * Used to handle complete events asynchronously. + * This avoids problems like deleting query objects in the + * handler or starting new query from the handler. + */ + CAsyncCallBack* iAsyncHandleQueryCompleteCaller; + + /** + * Monitors Mds server shutdown states. + */ + CVcxMdsShutdownMonitor* iMdsShutdownMonitor; + + /** + * Used for handling events on background. + */ + CIdle* iEventProcessor; + + /** + * Incoming events are stored here and "slowly" fed to observer. + */ + RArray iEvents; + +public: // Friend classes + + friend class CCollectionPluginTest; + + }; + +#endif // VCXMYVIDEOSMDSDB_H + diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosmessagelist_stub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosmessagelist_stub.h Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,153 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Groups messages and sends them to clients.* +*/ + + + + +#ifndef VCXMYVIDEOSMESSAGELIST_H +#define VCXMYVIDEOSMESSAGELIST_H + +// INCLUDES + +#include +#include + +// FORWARD DECLARATIONS +class CVcxMyVideosCollectionPlugin; + +// CONSTANTS + +// CLASS DECLARATION + +/** +* Groups messages and sends them to clients. +* +* @lib mpxmyvideoscollectionplugin.lib +*/ +NONSHARABLE_CLASS(CVcxMyVideosMessageList) : + public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor + * + * @param aCollection Collection, owner of this object. + * @return Object constructed + */ + static CVcxMyVideosMessageList* NewL ( CVcxMyVideosCollectionPlugin& aCollection ); + + /** + * Destructor + */ + virtual ~CVcxMyVideosMessageList(); + + private: + + /** + * Constructor + */ + CVcxMyVideosMessageList( CVcxMyVideosCollectionPlugin& aCollection ); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL (); + + /** + * Creates iMessageList if not created already. + */ + void CreateMessageListL(); + + /** + * Checks if this event is already on the message list. Used for + * optimizing duplicate events. + * + * @param aId MPX Item ID. + * @param aChange Change type. + * @param aExtraInfo Event extra info, see TVcxMyVideosEventInfo enum + * from vcxmyvideosdefs.h for values. + * @return ETrue if the event is already on the list, + * EFalse otherwise. + */ + TBool AlreadyInMessageListL( const TMPXItemId& aId, + TMPXChangeEventType aChange, TInt32 aExtraInfo ); + public: + + /** + * Creates collection change event and appends it to iMessageList. + * + * @param aId Context that was changed + * @param aChange Change type, see values from mpxcollectionmessagedefs.h. + * @param aExtraInfo Extra information about the event, this value is written to + * KVcxMediaMyVideosInt32Value attribute. If aExtraInfo + * is 0, nothing is written. See TVcxMyVideosEventInfo enum + * from vcxmyvideosdefs.h for values. + * @param aVideo Video object which is in cache already. + */ + void AddEventL(const TMPXItemId& aId, TMPXChangeEventType aChange, TInt32 aExtraInfo = 0, CMPXMedia* aVideo = NULL ); + + /** + * Creates My Videos custom event and appends it to iMessageList. + * + * @param aEvent Event ID, see values from vcxmyvideosdefs.h. + */ + void AddEventL( TInt aEvent ); + + /** + * Adds message to iMessageList. + * + * @param aMessage Message to add, may contain media array as a parameter. + */ + void AddL( CMPXMessage* aMessage ); + + /** + * Sends iMessageList to clients. + */ + void SendL(); + + private: + + /** + * Messages are collected here before sending. + */ + CMPXMessage* iMessageList; + + /** + * Array item of iMessageList, stored as member to speed things up. + * Owned by iMessageList. + */ + CMPXMessageArray* iMessageArray; + + /** + * Count of messages in iMessageList, main object plus items in array. + */ + TInt iMessageCount; + + /** + * My Videos collection plugin, owner of this object. + */ + CVcxMyVideosCollectionPlugin& iCollection; + + public: // Friend classes + + friend class CCollectionPluginTest; + + }; + +#endif // VCXMYVIDEOSMESSAGELIST_H + + diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosopenhandler_stub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosopenhandler_stub.h Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,212 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Handles collection Open operation related functionality +* +*/ + + +#ifndef VCXMYVIDEOSOPENHANDLER_H +#define VCXMYVIDEOSOPENHANDLER_H + +class CVcxMyVideosCollectionPlugin; +class MMPXCollectionPluginObserver; +class CVcxMyVideosMdsDb; + +#include "vcxmyvideosmdsdb_stub.h" +/** + */ +NONSHARABLE_CLASS( CVcxMyVideosOpenHandler ) : public CBase, public MVcxMyVideosMdsAlbumsObserver + { + friend class CVcxMyVideosVideoCache; + +public: + + /** + * Two-phased constructor + */ + static CVcxMyVideosOpenHandler* NewL( CVcxMyVideosCollectionPlugin& aCollection, + CVcxMyVideosVideoCache& aCache, + CVcxMyVideosMdsDb& aMds ); + + /** + * Destructor + */ + virtual ~CVcxMyVideosOpenHandler(); + +public: + + /** + * Handle collection Open operation. + * + * @param aPath Path to open. + */ + void OpenL( const CMPXCollectionPath& aPath ); + + /** + * 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 + */ + void ConstructL(); + + /** + * Default Constructor + */ + CVcxMyVideosOpenHandler( CVcxMyVideosCollectionPlugin& aCollection, + 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 + + /** + * Collection plugin main class. Owner of this object. + */ + CVcxMyVideosCollectionPlugin& iCollection; + + /** + * Videos cache, owned by iCollection. Reference is stored here + * just to avoid one pointer access. + */ + CVcxMyVideosVideoCache& iCache; + + /** + * Object for accessing MDS database, owned by iCollection. Reference is stored here + * just to avoid one pointer access. + */ + CVcxMyVideosMdsDb& iMds; + + /** + * The category ids being opened are stored here. These values are used + * to filter list when items arrive from MDS. KVcxMvcCategoryIdAll category is not listed here. + * This is in sync with iVideoListsBeingOpened. + */ + RArray iCategoryIdsBeingOpened; + + /** + * Video lists for categories being opened are stored here. + * 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; + +public: // Friend classes + + friend class CCollectionPluginTest; + + }; + +#endif // VCXMYVIDEOSACTIVETASK_H diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosvideocache_stub.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/inc/vcxmyvideosvideocache_stub.h Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,534 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Contains cached MDS media items* +*/ + + + +#ifndef VCXMYVIDEOSVIDEOCACHE_H +#define VCXMYVIDEOSVIDEOCACHE_H + +// INCLUDES +#include "vcxmyvideosmdsdb.h" + +// FORWARD DECLARATIONS +class CVcxMyVideosCollectionPlugin; +class CMPXMedia; +class CRepository; + +// CONSTANTS + +// CLASS DECLARATION + +/** + * Contains information about video. + * These are stored to CVcxMyVideosVideoListIndex::iVideoArray. + */ +NONSHARABLE_CLASS(TVcxMyVideosVideo) + { + public: + + /** + * Constructor. + */ + TVcxMyVideosVideo(); + + /** + * = operator. + */ + TVcxMyVideosVideo& operator=( const TVcxMyVideosVideo& aVideo ); + public: + + /** + * Set values. + * + * @param aMdsId MDS ID + * @param aPos Position in CVcxMyVideosVideoCache::iVideoList + * @param aVideo Pointer to CVcxMyVideosVideoCache::iVideoList item, + * ownership does not move. + */ + void Set( TUint32 aMdsId, TInt aPos, CMPXMedia* aVideo ); + + public: + TUint32 iMdsId; // Video object ID in MDS. + CMPXMedia* iVideo; // Pointer to CVcxMyVideosVideoCache::iVideoList item + TInt iPos; // Items position in CVcxMyVideosVideoCache::iVideoList + }; + +/** +* Used for keeping videos in MDS ID order for fast access. +* (Indexes CVcxMyVideosVideoCache::iVideoList). +* +* @lib mpxmyvideoscollectionplugin.lib +*/ +NONSHARABLE_CLASS(CVcxMyVideosVideoListIndex) : public CBase + { +public: // Constructors and destructor + + /** + * Two-phased constructor + * @return Object constructed + */ + static CVcxMyVideosVideoListIndex* NewL(); + + /** + * Destructor + */ + virtual ~CVcxMyVideosVideoListIndex(); + +public: + + /** + * Sets up iVideoArray from aVideoList. Sorting is also done. + * + * @param aVideoList Video list to use for constructing iVideoArray. + */ + void SetL( const CMPXMedia& aVideoList ); + + /** + * Finds video by MDS ID from the index. Uses bisection method. + * + * @param aVideo The found video data is written here. + * @return KErrNotFound if not found, index of the item in iVideoArray + * otherwise. + */ + TInt Find( TUint32 aMdsId, TVcxMyVideosVideo& aVideo ); + + /** + * Removes video from index. + * + * @param aMdsId ID if the item to be removed. + * @param aCompress If ETrue, compresses the video array. + * @return KErrNotFound if not found, index of the removed item otherwise. + */ + TInt Remove( TUint32 aMdsId, TBool aCompress = ETrue ); + + /** + * Adds video to index. Keeps sorting order. + * + * @param aVideo Video to be added, ownership does not move. + * @param aPos aVideo's position in CVcxMyVideosVideoCache::iVideoList. + */ + void AddL( CMPXMedia* aVideo, TInt aPos ); + +#ifdef _DEBUG + /** + * Returns reference to video array. + */ + const RArray& VideoArray(); +#endif + +private: + /** + * Constructor + */ + CVcxMyVideosVideoListIndex(); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL (); + + /** + * Sorts iVideoArray by MDS ID. + */ + void Sort(); + + /** + * Used for keeping RArray in integer order by + * TVcxMyVideosVideo::iMdsId. + * + * @param aVideo1 Video to compare + * @param aVideo2 Video to compare + * @return -1 if aVideo1 is smaller than aVideo2, 1 if aVideo1 is larger than + * aVideo2. + */ + static TInt CompareVideosByMdsId( const TVcxMyVideosVideo& aVideo1, + const TVcxMyVideosVideo& aVideo2 ); + +private: + + /** + * Video array which is kept in order by MDS ID. + */ + RArray iVideoArray; + }; + +/** +* Used for storing MDS items to RAM for fast access. +* +* @lib mpxmyvideoscollectionplugin.lib +*/ +NONSHARABLE_CLASS(CVcxMyVideosVideoCache) : public CBase + { + public: // Constructors and destructor + + /** + * Two-phased constructor + * @param aMyVideosCollectionPlugin Owner of this object. + * @return Object constructed + */ + static CVcxMyVideosVideoCache* NewL ( + CVcxMyVideosCollectionPlugin& aMyVideosCollectionPlugin ); + + /** + * Destructor + */ + virtual ~CVcxMyVideosVideoCache(); + + public: + + /** + * @return ETrue if iVideoList is complete. (All items have + * been fetched from MDS.) + */ + TBool IsComplete(); + + /** + * Set to ETrue when all items have been fetched from MDS. + */ + void SetComplete( TBool aComplete ); + + private: + /** + * Constructor + */ + CVcxMyVideosVideoCache( CVcxMyVideosCollectionPlugin& aMyVideosCollectionPlugin ); + + /** + * Symbian 2nd phase constructor. + */ + void ConstructL (); + + /** + * Finds correct position in iVideoList for the new video. + * + * @param aMedia Video to be inserted to the list. + * @param aSortingOrder Sorting order. + * @return Position in the cache. + */ + TInt FindCorrectPositionL( CMPXMedia& aMedia, TVcxMyVideosSortingOrder aSortingOrder ); + + /** + * Compares aNewVideo and aVideoInList in sizes, creation dates + * or titles. + * + * @param aNewVideo Video to be added to the list. + * @param aVideoInList Video in cache video list which is currently compared against + * aNewVideo. + * @param aSortingOrder Defines which attributes are compared. Size, Creation Date and Title + * are possible. + * @return -1 if aVideoInList has smaller value, 1 if greater and 0 if equal. + */ + TInt CompareL( CMPXMedia& aNewVideo, CMPXMedia& aVideoInList, + TVcxMyVideosSortingOrder aSortingOrder ); + + /** + * Adds video to iVideoList to the correct position, according to sorting order. + * MDS ID is used to identify the video. + * + * @param aVideo Video to add. + * @param aSortingOrder Sorting order used. + * @param aUpdateCategories If ETrue, then categories are updated. + * @return KErrNone if added, KErrAlreadyExists if already exists and + * was not added. + */ + TInt AddToCorrectPlaceL( CMPXMedia& aVideo, TVcxMyVideosSortingOrder aSortingOrder, + TBool aUpdateCategories = ETrue ); + + /** + * Moves a video to correct place on iVideoList, according to sorting order. + * aVideo should be a refrence to iVideoList item. After the call the referenced + * item is gone and the reference shouldn't be used anymore. + * + * @param aVideo Video to move. + * @param aSortingOrder Sorting order used. + */ + void MoveToCorrectPlaceL( CMPXMedia& aVideo, + TVcxMyVideosSortingOrder aSortingOrder ); + + /** + * Removes video from iVideoList or iPartialVideoList. + * MDS ID is used to identify the video. + * + * @param aVideo Video to remove, MDS ID is read from here. + * @param aUpdateCategories If ETrue, then categories are updated. + * @return KErrNotFound if not found, KErrNone otherwise. + */ + TInt RemoveL( CMPXMedia& aVideo, TBool aUpdateCategories = ETrue ); + + /** + * Fetches sorting order from Cenrep. + * @return Sorting order. + */ + TVcxMyVideosSortingOrder SortingOrderL(); + + /** + * Called when Title in video cache has been modified. + * Updates sorting order and category attributes if necessarry. + * NOTICE that aVideoInCache is not allowed to own the media object, since this + * function may change the pointer value to point to a new object. + * + * @param aVideoInCache Video in cache which Title has been modified. aVideoInCache + * is not allowed to own the data. + */ + void HandleVideoTitleModifiedL( CMPXMedia*& aVideoInCache ); + + /** + * Deletes iPartialList. + */ + void DeletePartialList(); + + /** + * Adds video to cache (iVideoList or iPartialVideoList). Ownership moves. + * + * @param aVideo Video to add. + * @param aSortingOrder Sorting order. + * @param aUpdateCategores If ETrue, then category and album attributes are updated. + * @return KErrNone if added, KErrAlreadyExists if already exists and + * was not added. + */ + TInt AddL( CMPXMedia* aVideo, TVcxMyVideosSortingOrder aSortingOrder, + TBool aUpdateCategories = ETrue ); + + /** + * Adds video to iPartialVideoList. Ownership moves. + * + * @param aVideo Video to add. + * @return KErrNone if item was added, KErrAlreadyExists if video + * was already on the list and was not added. + */ + TInt AddToPartialListL( CMPXMedia* aVideo ); + + /** + * Finds the array position of aVideo in iPartialVideoList . + * + * @param aVideo Video which position is searched. + * @return Position, KErrNotFound if item is not in iPartialVideoList. + */ + TInt PosOnPartialVideoListL( CMPXMedia& aVideo ); + + /** + * Finds the array position of aVideo in iVideoList. + * + * @param aVideo Video which position is searched. + * @return Position, KErrNotFound if item is not in iVideoList. + */ + TInt PosOnVideoListL( CMPXMedia& aVideo ); + +#ifdef _DEBUG + /** + * Checks that iVideoListIndex is correctly formed. + */ + void CheckVideoListIndexL(); +#endif + + public: + /** + * Creates filtered video list from iVideoList. This is used for + * showing video categories by origin. + * + * @param aOrigin Only videos with this origin are added to list, + * see values from TVcxMyVideosOrigin (in vcxmyvideosdefs.h). + * @return New video list, containing videos from aOrigin. + */ + CMPXMedia* CreateVideoListByOriginL( TUint8 aOrigin ); + + /** + * Appends items from aFromList to aToList if items origin is equal with + * aOrigin. This is used when fetching other than All category from MDS. + * + * @param aToList List to append + * @param aFromList List to append from. + * @param aOrigin Only items with this origin are copied. + * @param aNewItemsStartIndex Start index in aFromList where from the copying is started. + */ + void AppendToListL( CMPXMedia& aToList, CMPXMedia& aFromList, + TUint8 aOrigin, TInt aNewItemsStartIndex ); + + /** + * Tries to find media with matching URI from the cached video list. + * + * @param aUri URI to compare + * @return Contains pointer to media if match found, NULL otherwise. + * Pointer ownership is not moved to the caller. + */ + CMPXMedia* FindVideoByUriL( const TDesC& aUri ); + + /** + * Tries to find media with matching MdsId from iVideoList and iPartialVideoList. + * + * @param aMdsId ID to compare + * @param aPos If found from iVideoList, the position index is written here, + * KErrNotFound otherwise. If found from iPartialVideoList, then + * the value is still set to KErrNotFound. + * @return Contains pointer to media if match found, NULL otherwise. + * Pointer ownership is not moved to the caller. + */ + CMPXMedia* FindVideoByMdsIdL( TUint32 aMdsId, TInt& aPos ); + + /** + * Gets medias from iVideoList and iPartialVideoList. + * + * @param aMdsIds IDs of the items to fetch. + * @return Pointer to fetched items, KMPXMediaArrayContents + * attribute contains the media items. Ownership + * moves to caller. + */ + CMPXMedia* GetVideosL( RArray& aMdsIds ); + + /** + * Removes video from iVideoList (or from iPartialVideoList). + * + * @param aMdsId MDS ID of the video to be removed. + * @param aUpdateCategories If ETrue, then categories are updated. + * @return KErrNotFound if not found, KErrNone otherwise. + */ + TInt RemoveL( TUint32 aMdsId, TBool aUpdateCategories = ETrue ); + + /** + * Removes videos from iVideoList. + * + * @param aUpdateCategories If ETrue, then categories are updated. + * @param aMdsIds Array containing MDS IDs of the videos to be deleted. + */ + void RemoveL( RArray& aMdsIds, TBool aUpdateCategories = ETrue ); + + /** + * Adds videos to cache (iVideoList or iPartialVideoList). After the function call aMdsIds + * will contain only those items which were actually added to cache. + * + * @param aMdsIds Array containing MDS IDs of the videos to be added. + * @param aListFetchingWasCanceled This is set to EFalse if video list fetching from mds + * had to be cancelled. EFalse otherwise. + * @param aNonVideoIds If argument given then Ids which were detected to not be + * videos are written here. Caller owns the array, ownership + * does not move. + * @param aUpdateCategories If ETrue, then category/album attributes are updated. + */ + void AddVideosFromMdsL( RArray& aMdsIds, TBool& aListFetchingWasCanceled, + RArray* aNonVideoIds = NULL, TBool aUpdateCategories = ETrue ); + + /** + * Deletes old and creates new iVideoList. After the function call iVideoList exists, + * but it might not contain any media items yet, only empty array. + * Media items are added to the list asynchronoysly in + * VcxMyVideosColletionPlugin::HandleCreateVideoListResp(), called by + * VcxMyVideosMdsDb. Once iVideoList is complete, iVideoListIsPartial + * is set to EFalse. During the video list fetching + * VcxMyVideosMdsDb::iVideoListFetchingIsOngoing is ETrue. + * If there is video list creation already ongoing + * and the aSortingOrder is the same, nothing is done. + * During the video list fetching iPartialVideoList items are moved to + * iVideoList. When fetch is complete, iPartialVideoList is empty. + * + * @param aForce If ETrue, then the list is always created from scratch, possible + * ongoing fetch is cancelled. + */ + void CreateVideoListL( TBool aForce = EFalse ); + + /** + * Resets iVideoList (removes items, empty list is left) and cancels possible ongoing + * asynchronous videolist fetching. iVideoListIsPartial is set to ETrue. + * CVcxMyVideosCollection plugin variables are not touched. Caller is responsible to + * either cancel the fetch from plugin, or restart fetch from mds in a way that + * client gets its list. iVideoList media object remains pointing to same shared data. + */ + void ResetVideoListL(); + + /** + * Updates video attributes in cache from aVideo. NOTE: iVideoList might be changed + * if Size or Title values are modified and matching sorting order is currently on. + * Pointers to iVideoList items should be refreshed after calling this with size and title + * parameters. + * + * @param aVideo Attributes are read from here and updated to cache if difference exists. + * @return ETrue if any parameter was changed. + */ + TBool UpdateVideoL( CMPXMedia& aVideo ); + + /** + * iVideoList and its media array are deleted and recreated. New instances point to + * different global heap position. Media objects stay the same and point to + * same global heap. + */ + void ReCreateVideoListL(); + + /** + * Replaces items in iVideoList with items from iPartialVideoList. + * Called by iCollection when fetching videolist. + */ + void CheckForPartialVideoListItemsL( TInt aNewItemsStartIndex ); + + public: + + /** + * Contains list of all videos in MDS. Used for caching MDS to RAM. + */ + CMPXMedia* iVideoList; + + /** + * Items fetched by MDS ID which don't (yet) have instance in iVideoList + * are added here. When iVideoList instance is received from MDS, it is + * replaced by item from iPartialVideoList and instance from iPartialVideoList + * is removed. + */ + RArray iPartialVideoList; + + /** + * Sorting order which was used last time when list was queryed from MDS. + */ + TVcxMyVideosSortingOrder iLastSortingOrder; + + /** + * Set to ETrue when doing videolist fetching. + */ + TBool iIsFetchingVideoList; + + private: + + /** + * If ETrue then iVideoList contains all items from MDS. + */ + TBool iVideoListIsComplete; + + /** + * My Videos collection plugin, owner of this object. + */ + CVcxMyVideosCollectionPlugin& iCollection; + + /** + * Index which keeps TVcxMyVidesVideo items indexed in MDS ID + * order for fast access. + */ + CVcxMyVideosVideoListIndex* iVideoListIndex; + + /** + * Provides access to the sorting order key in cenrep. Own. + */ + CRepository* iCenRep; + + public: // Friend classes + + // used in testing + TBool iLeaveOnReset; + TBool iCancelListFetching; + + friend class CCollectionPluginTest; + + }; + +#endif // VCXMYVIDEOSVIDEOCACHE_H + + diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/init/testframework.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/init/testframework.ini Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,197 @@ +# +# This is STIF initialization file +# Comment lines start with '#'-character. +# See STIF TestFramework users guide.doc for instructions + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set following test engine settings: +# - Set Test Reporting mode. TestReportMode's possible values are: +# + 'Summary': Summary of the tested test cases. +# + 'Environment': Hardware and software info. +# + 'TestCases': Test case report. +# + 'FullReport': Set of all above ones. +# + Example 'TestReportMode= Summary TestCases' +# +# - CreateTestReport setting controls report creation mode +# + YES, Test report will created. +# + NO, No Test report. +# +# - File path indicates the base path of the test report. +# - File name indicates the name of the test report. +# +# - File format indicates the type of the test report. +# + TXT, Test report file will be txt type, for example 'TestReport.txt'. +# + HTML, Test report will be html type, for example 'TestReport.html'. +# +# - File output indicates output source of the test report. +# + FILE, Test report logging to file. +# + RDEBUG, Test report logging to using rdebug. +# +# - File Creation Mode indicates test report overwriting if file exist. +# + OVERWRITE, Overwrites if the Test report file exist. +# + APPEND, Continue logging after the old Test report information if +# report exist. +# - Sets a device reset module's dll name(Reboot). +# + If Nokia specific reset module is not available or it is not correct one +# StifHWResetStub module may use as a template for user specific reset +# module. +# - Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation +# DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02 +# + +[Engine_Defaults] + +TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment', + 'TestCases' or 'FullReport' + +CreateTestReport= YES # Possible values: YES or NO + +TestReportFilePath= c:\logs\testframework\ +TestReportFileName= testreport + +TestReportFormat= TXT # Possible values: TXT or HTML +TestReportOutput= FILE # Possible values: FILE or RDEBUG +TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting + +DisableMeasurement= stifmeasurementdisablenone # Possible values are: + # 'stifmeasurementdisablenone', 'stifmeasurementdisableall' + # 'stifmeasurementplugin01', 'stifmeasurementplugin02', + # 'stifmeasurementplugin03', 'stifmeasurementplugin04', + # 'stifmeasurementplugin05' or 'stifbappeaprofiler' + +UITestingSupport= YES +SeparateProcesses= YES +[End_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Module configurations start +# Modules are added between module tags +# tags. Module name is specified after ModuleName= tag, like +# ModuleName= XXXXXXXXX +# Modules might have initialisation file, specified as +# IniFile= c:\testframework\YYYYYY +# Modules might have several configuration files, like +# TestCaseFile= c:\testframework\NormalCases.txt +# TestCaseFile= c:\testframework\SmokeCases.txt +# TestCaseFile= c:\testframework\ManualCases.txt + +# (TestCaseFile is synonym for old term ConfigFile) + +# Following case specifies demo module settings. Demo module +# does not read any settings from file, so tags +# IniFile and TestCaseFile are not used. +# In the simplest case it is enough to specify only the +# name of the test module when adding new test module + +[New_Module] +ModuleName= TestScripter +TestCaseFile= c:\TestFramework\ut_collectionplugintest.cfg +[End_Module] + + +# Load testmoduleXXX, optionally with initialization file and/or test case files +#[New_Module] +#ModuleName= testmodulexxx + +#TestModuleXXX used initialization file +#IniFile= c:\testframework\init.txt + +#TestModuleXXX used configuration file(s) +#TestCaseFile= c:\testframework\testcases1.cfg +#TestCaseFile= c:\testframework\testcases2.cfg +#TestCaseFile= c:\testframework\manualtestcases.cfg + +#[End_Module] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + + + +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +# Set STIF logging overwrite parameters for Logger. +# Hardware and emulator environment logging path and styles can +# be configured from here to overwrite the Logger's implemented values. +# +# Settings description: +# - Indicates option for creation log directory/directories. If log directory/directories +# is/are not created by user they will make by software. +# + YES, Create log directory/directories if not allready exist. +# + NO, Log directory/directories not created. Only created one is used. +# +# - Overwrite emulator path setting. +# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined +# Logger's path 'D:\\LOGS\\Module\\' with those definition the path +# will be 'C:\LOGS\TestFramework\LOGS\Module\' +# +# - Overwrite emulator's logging format. +# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'. +# + HTML, Log file(s) will be html type(s), for example 'Module.html'. +# +# - Overwrited emulator logging output source. +# + FILE, Logging to file(s). +# + RDEBUG, Logging to using rdebug(s). +# +# - Overwrite hardware path setting (Same description as above in emulator path). +# - Overwrite hardware's logging format(Same description as above in emulator format). +# - Overwrite hardware's logging output source(Same description as above in emulator output). +# +# - File Creation Mode indicates file overwriting if file exist. +# + OVERWRITE, Overwrites if file(s) exist. +# + APPEND, Continue logging after the old logging information if file(s) exist. +# +# - Will thread id include to the log filename. +# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'. +# + NO, No thread id to log file(s), Example filename 'Module.txt'. +# +# - Will time stamps include the to log file. +# + YES, Time stamp added to each line in log file(s). Time stamp is +# for example'12.Nov.2003 115958 LOGGING INFO' +# + NO, No time stamp(s). +# +# - Will line breaks include to the log file. +# + YES, Each logging event includes line break and next log event is in own line. +# + NO, No line break(s). +# +# - Will event ranking include to the log file. +# + YES, Event ranking number added to each line in log file(s). Ranking number +# depends on environment's tics, for example(includes time stamp also) +# '012 12.Nov.2003 115958 LOGGING INFO' +# + NO, No event ranking. +# +# - Will write log file in unicode format. +# + YES, Log file will be written in unicode format +# + NO, Log will be written as normal, not unicode, file. +# + +[Logger_Defaults] + +#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#' +#NOTE: TestEngine and TestServer logging settings cannot change here + +CreateLogDirectories= YES # Possible values: YES or NO + +EmulatorBasePath= C:\ +EmulatorFormat= TXT # Possible values: TXT or HTML +EmulatorOutput= FILE # Possible values: FILE or RDEBUG + +HardwareBasePath= f:\ +HardwareFormat= TXT # Possible values: TXT or HTML +HardwareOutput= FILE # Possible values: FILE or RDEBUG + +FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND + +ThreadIdToLogFile= YES # Possible values: YES or NO +WithTimeStamp= YES # Possible values: YES or NO +WithLineBreak= YES # Possible values: YES or NO +WithEventRanking= YES # Possible values: YES or NO + +FileUnicode= YES # Possible values: YES or NO +AddTestCaseTitle= YES # Possible values: YES or NO +[End_Logger_Defaults] +# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- + +# End of file diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/ut_collectionplugintest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/ut_collectionplugintest.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,164 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Video Playback User Input Handler test class for STIF testing +* +*/ + +// Version : %version: 1 % + + +// INCLUDE FILES +#include +#include +#include + +#include +#include +#include +#include "vcxmyvideosactivetask.h" +#include "vcxmyvideosmdsdb.h" +#include "vcxmyvideosvideocache_stub.h" +#include "ut_collectionplugintest.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest::CCollectionPluginTest +// C++ default constructor can NOT contain any code, that +// might leave. +// ----------------------------------------------------------------------------- +// +CCollectionPluginTest::CCollectionPluginTest( CTestModuleIf& aTestModuleIf ) + : CScriptBase( aTestModuleIf ) +{ +} + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest::ConstructL +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CCollectionPluginTest::ConstructL() +{ + //Read logger settings to check whether test case name is to be + //appended to log file name. + RSettingServer settingServer; + + TInt ret = settingServer.Connect(); + + if ( ret != KErrNone ) + { + User::Leave(ret); + } + + // Struct to StifLogger settigs. + TLoggerSettings loggerSettings; + + // Parse StifLogger defaults from STIF initialization file. + ret = settingServer.GetLoggerSettings(loggerSettings); + + if ( ret != KErrNone ) + { + User::Leave(ret); + } + + // Close Setting server session + settingServer.Close(); + + TFileName logFileName; + + if ( loggerSettings.iAddTestCaseTitle ) + { + TName title; + TestModuleIf().GetTestCaseTitleL(title); + logFileName.Format(KCollectionplugintest_LogFileWithTitle, &title); + } + else + { + logFileName.Copy(KCollectionplugintest_LogFile); + } + + iLog = CStifLogger::NewL( KCollectionplugintest_LogPath, + logFileName, + CStifLogger::ETxt, + CStifLogger::EFile, + EFalse ); + + SendTestClassVersion(); + + TestModuleIf().SetBehavior( CTestModuleIf::ETestLeaksHandles ); + + CreateL(); +} + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest::NewL +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CCollectionPluginTest* CCollectionPluginTest::NewL( CTestModuleIf& aTestModuleIf ) +{ +CCollectionPluginTest* self = new (ELeave) CCollectionPluginTest( aTestModuleIf ); + + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop(); + + return self; +} + +// Destructor +CCollectionPluginTest::~CCollectionPluginTest() +{ + // Delete resources allocated from test methods + Delete(); + + // Delete logger + delete iLog; + + REComSession::FinalClose(); +} + +//----------------------------------------------------------------------------- +// CCollectionPluginTest::SendTestClassVersion +// Method used to send version of test class +//----------------------------------------------------------------------------- +// +void CCollectionPluginTest::SendTestClassVersion() +{ + TVersion moduleVersion; + moduleVersion.iMajor = TEST_CLASS_VERSION_MAJOR; + moduleVersion.iMinor = TEST_CLASS_VERSION_MINOR; + moduleVersion.iBuild = TEST_CLASS_VERSION_BUILD; + + TFileName moduleName; + moduleName = _L("ut_collectionplugintest.dll"); + + TBool newVersionOfMethod = ETrue; + TestModuleIf().SendTestModuleVersion(moduleVersion, moduleName, newVersionOfMethod); +} + +// ========================== OTHER EXPORTED FUNCTIONS ========================= + +// ----------------------------------------------------------------------------- +// LibEntryL is a polymorphic Dll entry point. +// Returns: CScriptBase: New CScriptBase derived object +// ----------------------------------------------------------------------------- +// +EXPORT_C CScriptBase* LibEntryL( CTestModuleIf& aTestModuleIf ) +{ + return ( CScriptBase* ) CCollectionPluginTest::NewL( aTestModuleIf ); +} + +// End of File diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/ut_collectionplugintestBlocks.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/ut_collectionplugintestBlocks.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,1301 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Video Playback User Input Handler Test class for STIF unit testing +* +*/ + +// Version : %version: 1 % + + + +// [INCLUDE FILES] - do not remove +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ut_collectionplugintest.h" + +#include "mpxlog.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include "vcxmyvideosactivetask.h" +#include "vcxmyvideosmdsdb.h" +#include "vcxmyvideosvideocache_stub.h" + +#define private public +#include "vcxmyvideoscollectionplugin.h" +#undef private + +_LIT( KTestModuleName, "CollectionPluginTest" ); +_LIT( KLogLocation, "In %S" ); + +const TInt KInvalidId( -100 ); +const TInt KSelectAll( -2 ); + +enum EMPXMediaAttribute + { + ETestMediaGeneralId = 1, + ETestMediaTitle + }; + +enum EStubs + { + EActiveTask = 1, + EAlbums, + EAsyncFileOperations, + ECategories, + EMDSDB, + EMessageList, + EOpenHandler, + EVideoCache + }; + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest::Delete +// Delete here all resources allocated and opened from test methods. +// Called from destructor. +// ----------------------------------------------------------------------------- +// +void CCollectionPluginTest::Delete() +{ + if( iCollection ) + { + delete iCollection; + iCollection = NULL; + } + + if( iPath ) + { + delete iPath; + iPath = NULL; + } + + if( iMessageList ) + { + iMessageList->Reset(); + delete iMessageList; + iMessageList = NULL; + } + + if( iMedia ) + { + delete iMedia; + iMedia = NULL; + } + + if( iCommand ) + { + delete iCommand; + iCommand = NULL; + } + + iAttrs.Close(); +} + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest::CreateL +// ----------------------------------------------------------------------------- +// +void CCollectionPluginTest::CreateL() +{ + TInt arguments( 0 ); + iCollection = CVcxMyVideosCollectionPlugin::NewL( &arguments ); + iCollection->SetObserver( *this ); + iMessageList = CMPXMediaArray::NewL(); + iPath = CMPXCollectionPath::NewL(); +} + + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest::RunMethodL +// Run specified method. Contains also table of test mothods and their names. +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::RunMethodL( CStifItemParser& aItem ) +{ + static TStifFunctionInfo const KFunctions[] = + { + // Copy this line for every implemented function. + // First string is the function name used in TestScripter script file. + // Second is the actual implementation member function. + ENTRY( "CreateNewMedia", CCollectionPluginTest::CreateNewMediaL ), + ENTRY( "SetMediaAttribute", CCollectionPluginTest::SetMediaAttributeL ), + ENTRY( "AddMediaToCache", CCollectionPluginTest::AddMediaToCacheL ), + ENTRY( "RemoveMediaFromCache", CCollectionPluginTest::RemoveMediaFromCacheL ), + ENTRY( "CheckMediaCount", CCollectionPluginTest::CheckMediaCountL ), + ENTRY( "OpenL", CCollectionPluginTest::OpenL ), + ENTRY( "SelectPath", CCollectionPluginTest::SelectPathL ), + ENTRY( "SelectPathId", CCollectionPluginTest::SelectPathIdL ), + ENTRY( "InsertToPath", CCollectionPluginTest::InsertToPathL ), + ENTRY( "SelectAttributes", CCollectionPluginTest::SelectAttributesL ), + ENTRY( "MediaL", CCollectionPluginTest::MediaL ), + ENTRY( "CancelRequest", CCollectionPluginTest::CancelRequest ), + ENTRY( "CommandL", CCollectionPluginTest::CommandL ), + ENTRY( "FindAllL", CCollectionPluginTest::FindAllL ), + ENTRY( "FindAllSyncL", CCollectionPluginTest::FindAllSyncL ), + ENTRY( "GetCapabilities", CCollectionPluginTest::GetCapabilities ), + ENTRY( "AddL", CCollectionPluginTest::AddL ), + ENTRY( "RemoveL", CCollectionPluginTest::RemoveL ), + ENTRY( "SetL", CCollectionPluginTest::SetL ), + ENTRY( "HandleStepL", CCollectionPluginTest::HandleStepL ), + ENTRY( "CreateNewCmd", CCollectionPluginTest::CreateNewCmdL ), + ENTRY( "CheckCurrentCmd", CCollectionPluginTest::CheckCurrentCmdL ), + ENTRY( "SetNewCmd", CCollectionPluginTest::SetNewCmdL ), + ENTRY( "SetVideoListFetching", CCollectionPluginTest::SetVideoListFetchingL ), + ENTRY( "CancelCacheListFetching", CCollectionPluginTest::CancelCacheListFetchingL ), + ENTRY( "HandleMyVideosDbEvent", CCollectionPluginTest::HandleMyVideosDbEvent ), + ENTRY( "HandleCreateVideoListResp", CCollectionPluginTest::HandleCreateVideoListResp ), + ENTRY( "HandleObjectPresentNotification", CCollectionPluginTest::HandleObjectPresentNotificationL ), + ENTRY( "AddVideoToMdsAndCacheL", CCollectionPluginTest::AddVideoToMdsAndCacheL ), + ENTRY( "SetVideoL", CCollectionPluginTest::SetVideoL ), + ENTRY( "SendMyVideosMessageL", CCollectionPluginTest::SendMyVideosMessageL ), + ENTRY( "SendMessages", CCollectionPluginTest::SendMessages ), + ENTRY( "CategoriesL", CCollectionPluginTest::CategoriesL ), + ENTRY( "NotifyNewVideosCountDecreasedL", CCollectionPluginTest::NotifyNewVideosCountDecreasedL ), + ENTRY( "DeleteStub", CCollectionPluginTest::DeleteStubL ), + ENTRY( "AlbumsL", CCollectionPluginTest::AlbumsL ), + }; + + const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo ); + + return RunInternalL( KFunctions, count, aItem ); +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void CCollectionPluginTest::LogMethod( TPtrC aMethod ) + { + // Print to UI + TBuf< 64 > buffer; + buffer.Format( KLogLocation, &aMethod ); + TestModuleIf().Printf( 0, KTestModuleName, buffer ); + // Print to log file + iLog->Log( buffer ); + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest::SetMessageResponse +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::DeleteStubL( CStifItemParser& aItem ) + { + TInt error( KErrNone ); + TInt stub( KErrNotFound ); + aItem.GetNextInt( stub ); + + switch( stub ) + { + case EActiveTask: + TRAP( error, delete iCollection->iActiveTask ); + break; + case EAlbums: + TRAP( error, delete iCollection->iAlbums ); + break; + case EAsyncFileOperations: + TRAP( error, delete iCollection->iAsyncFileOperations ); + break; + case ECategories: + TRAP( error, delete iCollection->iCategories ); + break; + case EMDSDB: + TRAP( error, delete iCollection->iMyVideosMdsDb ); + break; + case EMessageList: + TRAP( error, delete iCollection->iMessageList ); + break; + case EOpenHandler: + TRAP( error, delete iCollection->iOpenHandler ); + break; + case EVideoCache: + TRAP( error, delete iCollection->iCache ); + break; + default: + break; + } + + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest::CheckMessageResponse +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::CheckCurrentCmdL( CStifItemParser& aItem ) + { + TInt error( KErrNone ); + + aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); + + // CMD ID + TUint32 cmdId( 0 ); + TPtrC cmdIdStr; + if( aItem.GetNextString( cmdIdStr ) == KErrNone ) + { + TLex lex( cmdIdStr ); + lex.Val( cmdId, EHex ); + } + + // MV CMD ID + TInt cmdMV( KErrNotFound ); + if( cmdId == KVcxCommandIdMyVideos ) + { + aItem.GetNextInt( cmdMV ); + } + + if( iCollection->iActiveTask->iCurCommand == NULL && !cmdId ) + { + return KErrNone; + } + + TMPXCommandId commandId = iCollection->iActiveTask->iCurCommand->ValueTObjectL( KMPXCommandGeneralId ); + if( commandId != cmdId ) + { + error = KErrCorrupt; + } + + if( commandId == KVcxCommandIdMyVideos ) + { + TInt currCmdMV = iCollection->iActiveTask->iCurCommand->ValueTObjectL( KVcxMediaMyVideosCommandId ); + if( currCmdMV != cmdMV ) + { + error = KErrCorrupt; + } + } + + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest::CreateNewMediaL +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::CreateNewMediaL( CStifItemParser& /*aItem*/ ) + { + delete iMedia; + iMedia = NULL; + iMedia = CMPXMedia::NewL(); // NULL; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest::CreateNewMediaL +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::SetMediaAttributeL( CStifItemParser& aItem ) + { + CleanupStack::PushL( iMedia ); + + aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); + TInt attribute( KErrNotFound ); + aItem.GetNextInt( attribute ); + switch( attribute ) + { + case ETestMediaGeneralId: + { + TInt mediaId( 0 ); + aItem.GetNextInt( mediaId ); + TInt mediaType( KVcxMvcMediaTypeVideo ); + aItem.GetNextInt( mediaType ); + TMPXItemId mpxId( mediaId, mediaType ); + iMedia->SetTObjectValueL( KMPXMediaGeneralId, mpxId ); + } + break; + + case ETestMediaTitle: + { + TPtrC value; + aItem.GetNextString( value ); + iMedia->SetTextValueL( KMPXMediaGeneralTitle, value ); + } + break; + default: + break; + } + CleanupStack::Pop( iMedia ); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest::CreateNewCmdL +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::CreateNewCmdL( CStifItemParser& aItem ) + { + TInt error( KErrNone ); + + aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); + + // COMMAND SYNC + TInt paramSync( 0 ); + aItem.GetNextInt( paramSync ); + + // CMD ID + TUint32 cmdId( 0 ); + TPtrC cmdIdStr; + if( aItem.GetNextString( cmdIdStr ) == KErrNone ) + { + TLex lex( cmdIdStr ); + User::LeaveIfError( lex.Val( cmdId, EHex ) ); + } + + // MV CMD ID + TInt cmdMV( KErrNotFound ); + if( cmdId == KVcxCommandIdMyVideos ) + { + aItem.GetNextInt( cmdMV ); + } + + delete iCommand; + iCommand = NULL; + iCommand = CreateMpxCommandLC( cmdId, cmdMV, paramSync ); + + switch( cmdId ) + { + case KMPXCommandIdCollectionAdd: // SYNC + { + iCommand->SetCObjectValueL( KMPXCommandColAddMedia, iMedia ); + } + break; + + case KMPXCommandIdCollectionSet: // SYNC + { + iCommand->SetCObjectValueL( KMPXCommandColSetMedia, iMedia ); + } + break; + + case KMPXCommandIdCollectionRemoveMedia: + { + TMPXItemId itemId = iMedia->ValueTObjectL( KMPXMediaGeneralId ); + iCommand->SetTObjectValueL( KMPXMediaGeneralId, itemId ); + } + break; + default: + break; + } + + switch( cmdMV ) + { + case KVcxCommandMyVideosGetMediaFullDetailsByMpxId: + { + TMPXItemId itemId = iMedia->ValueTObjectL( KMPXMediaGeneralId ); + iCommand->SetTObjectValueL( KMPXMediaGeneralId, itemId ); + } + break; + case KVcxCommandMyVideosGetMediasByMpxId: + { + CMPXMediaArray* mediaArray = CMPXMediaArray::NewL(); + CleanupStack::PushL( mediaArray ); + + TInt id( 0 ); + + while( aItem.GetNextInt( id ) == KErrNone ) + { + CMPXMedia* item = CMPXMedia::NewL(); + CleanupStack::PushL( item ); + TMPXItemId itemId; + itemId.iId1 = id; + itemId.iId2 = KVcxMvcMediaTypeVideo; + item->SetTObjectValueL( KMPXMediaGeneralId, itemId ); + mediaArray->AppendL( *item ); + CleanupStack::PopAndDestroy( item ); + } + if( id != KErrNotFound ) + { + iCommand->SetCObjectValueL( KMPXMediaArrayContents, mediaArray ); + } + CleanupStack::Pop( mediaArray ); + } + break; + case KVcxCommandMyVideosMove: + case KVcxCommandMyVideosCopy: + case KVcxCommandMyVideosDelete: + case KVcxCommandMyVideosCancelMoveOrCopy: // SYNC + case KVcxCommandMyVideosCancelDelete: // SYNC + case KVcxCommandMyVideosAddAlbum: // SYNC + case KVcxCommandMyVideosAddToAlbum: // ASYNC + case KVcxCommandMyVideosRemoveFromAlbum: // ASYNC + { + if( iMedia ) + { + iCommand->SetCObjectValueL( KMPXCommandColSetMedia, iMedia ); + } + } + break; + default: + break; + } + + CleanupStack::Pop( iCommand ); + + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::SetNewCmdL( CStifItemParser& /*aItem*/ ) + { + LogMethod(_L("SetNewCmdL")); + TRAPD( error, iCollection->iActiveTask->SetNewCommandL( *iCommand ) ); + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest::SetListCacheFetching +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::CancelCacheListFetchingL( CStifItemParser& aItem ) + { + LogMethod(_L("CancelCacheListFetchingL")); + TInt value( KErrNotFound ); + aItem.GetNextInt( value ); + TBool enabled( value ); + TRAPD( error, iCollection->iCache->iCancelListFetching = enabled ); + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest::AddMediaToCacheL +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::AddMediaToCacheL( CStifItemParser& /*aItem*/ ) + { + CMPXMediaArray* cache = iCollection->iCache->iVideoList->Value( KMPXMediaArrayContents ); + TRAPD( error, cache->AppendL( *iMedia ) ); + iCollection->iCache->iVideoList->SetCObjectValueL( KMPXMediaArrayContents, cache); + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +/* +TInt CCollectionPluginTest::AddMediaToCacheL( CStifItemParser& aItem ) + { + LogMethod(_L("AddMediaToCache")); + + TInt err( 0 ); + + CMPXMedia* media = CMPXMedia::NewL(); + TInt mediaId( 0 ); + aItem.GetNextInt( mediaId ); + TMPXItemId mpxId( mediaId, 0 ); + media->SetTObjectValueL( KMPXMediaGeneralId, mpxId ); + + CMPXMediaArray* medias = iCollection->iCache->iVideoList->Value( KMPXMediaArrayContents ); + medias->AppendL(*media); + delete media; + + return err; + }*/ + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::RemoveMediaFromCacheL( CStifItemParser& aItem ) + { + LogMethod(_L("RemoveMediaFromCache")); + + TInt err = ( -1 ); + + TInt mediaId( 0 ); + aItem.GetNextInt( mediaId ); + + CMPXMediaArray* medias = iCollection->iCache->iVideoList->Value( KMPXMediaArrayContents ); + for ( TInt i = 0; i < medias->Count(); i++ ) + { + CMPXMedia* media = (*medias)[i]; + TMPXItemId itemId = *(media->Value( KMPXMediaGeneralId )); + if( itemId.iId1 == mediaId ) + { + medias->Remove(i); + err = KErrNone; + break; + } + } + + return err; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::OpenL( CStifItemParser& aItem ) + { + LogMethod(_L("OpenL")); + + aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); + TInt32 collectionId( KErrNotFound ); + TPtrC collectionIdStr; + if( aItem.GetNextString( collectionIdStr ) == KErrNone ) + { + TLex lex( collectionIdStr ); + lex.Val( collectionId, EHex ); + } + + CleanupStack::PushL( iPath ); + + iPath->Reset(); + + switch( collectionId ) + { + case KErrNotFound: + break; + case KInvalidId: + iPath->AppendL( TMPXItemId::InvalidId() ); + break; + case 0: + iPath->AppendL( KVcxUidMyVideosMpxCollection ); + break; + default: + iPath->AppendL( collectionId ); + break; + } + + TMPXItemId item(1, 1); + iPath->AppendL(item); + + RArray attrs; + CMPXFilter* filter = CMPXFilter::NewL(); + + TRAPD( error, iCollection->OpenL( *iPath, attrs.Array(), filter ) ); + + CleanupStack::Pop( iPath ); + attrs.Reset(); + attrs.Close(); + delete filter; + return error; // error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest::InsertToPathL +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::InsertToPathL( CStifItemParser& aItem ) + { + LogMethod(_L("InsertToPathL")); + + //aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); + TInt id( KErrNotFound ); + TInt type( KErrNotFound ); + + aItem.GetNextInt( id ); + aItem.GetNextInt( type ); + TMPXItemId itemId( id, type ); + CleanupStack::PushL( iPath ); + TRAPD( error, iPath->InsertL(itemId, iPath->Count()-1) ); + CleanupStack::Pop( iPath ); + + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest::SelectPathL +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::SelectPathL( CStifItemParser& aItem ) + { + LogMethod(_L("SelectPathL")); + + CleanupStack::PushL( iPath ); + + //aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); + TInt index( KErrNotFound ); + aItem.GetNextInt( index ); + + TInt pathcount = iPath->Count(); + + TInt error( KErrNotFound ); + switch( index ) + { + case KSelectAll: + TRAP( error, iPath->SelectAllL() ); + break; + case KErrNotFound: + TRAP( error, iPath->DeselectAll() ); + break; + case KInvalidId: + TRAP( error, iPath->SelectL( TMPXItemId::InvalidId() ) ); + break; + default: + TRAP( error, iPath->SelectL( index ) ); + break; + } + + CleanupStack::Pop( iPath ); + + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest::SelectPathL +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::SelectPathIdL( CStifItemParser& aItem ) + { + LogMethod(_L("SelectPathL")); + CleanupStack::PushL( iPath ); + TInt id( KErrNotFound ); + aItem.GetNextInt( id ); + TInt pathcount = iPath->Count(); + TMPXItemId itemId( id, KVcxMvcMediaTypeVideo ); + TRAPD( error, iPath->SelectL( itemId ) ); + CleanupStack::Pop( iPath ); + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest::SelectPathL +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::SelectAttributesL( CStifItemParser& aItem ) + { + LogMethod(_L("SelectAttributesL")); + + //aItem.SetParsingType( CStifItemParser::EQuoteStyleParsing ); + iAttrs.Reset(); + TInt attr( KErrNotFound ); + aItem.GetNextInt( attr ); + switch( attr ) + { + case ETestMediaGeneralId: + iAttrs.AppendL( KMPXMediaGeneralId ); + break; + default: + break; + } + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::MediaL( CStifItemParser& /*aItem*/ ) + { + LogMethod(_L("MediaL")); + + RArray caps; + CleanupClosePushL(caps); + caps.AppendL(ECapability_None); + /*if (aCaps.HasCapability(ECapabilityDRM)) + { + caps.AppendL(ECapabilityDRM); + }*/ + // else add further "relevant" capabilities here + + // Add "none" capability, if no caps listed + /*if (caps.Count() == 0) + { + caps.AppendL(ECapability_None); + }*/ + + CMPXMedia* specs = CMPXMedia::NewL(); + + TRAPD( error, iCollection->MediaL( *iPath, iAttrs.Array(), caps.Array(), specs ) ); + delete specs; + CleanupStack::PopAndDestroy(&caps); + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::CheckMediaCountL( CStifItemParser& aItem ) + { + LogMethod(_L("CheckMediaCount")); + + TInt err( 0 ); + + TInt expected( 0 ); + aItem.GetNextInt( expected ); + + CMPXMediaArray* medias = iCollection->iCache->iVideoList->Value( KMPXMediaArrayContents ); + if( medias->Count() != expected ) + { + err = KErrCorrupt; + } + + return err; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::CancelRequest( CStifItemParser& /*aItem*/ ) + { + LogMethod(_L("CancelRequest")); + + iCollection->CancelRequest(); + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::CommandL( CStifItemParser& aItem ) + { + LogMethod(_L("CommandL")); + CreateNewCmdL( aItem ); + TRAPD( error, iCollection->CommandL( *iCommand ) ); + +#ifndef _DEBUG + // KMPXCommandIdCollectionAdd leaves with KErrNotSupported if the build is not udeb + // and it cannot be checked with STIF, so here's a solution + + TMPXCommandId cmdId = iCollection->iActiveTask->iCurCommand->ValueTObjectL( KMPXCommandGeneralId ); + if( cmdId == KMPXCommandIdCollectionAdd && error == KErrNotSupported ) + { + error = KErrNone; + } +#endif + + return error; + } + +// ----------------------------------------------------------------------------- +// CVCXMyVideosCollectionPluginTester::CreateMpxCommandLC +// ----------------------------------------------------------------------------- +// +CMPXCommand* CCollectionPluginTest::CreateMpxCommandLC( TInt aCommandGeneralId, + TInt aMyVideosCommandId, + TInt aSync ) + { + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + + if( aCommandGeneralId != 0 ) + { + cmd->SetTObjectValueL( KMPXCommandGeneralId, aCommandGeneralId ); + if( aCommandGeneralId == KVcxCommandIdMyVideos && aMyVideosCommandId != KErrNotFound ) + { + cmd->SetTObjectValueL( KVcxMediaMyVideosCommandId, aMyVideosCommandId ); + } + } + + if( aSync != KErrNotFound ) + { + TBool asyncBool( aSync ); + cmd->SetTObjectValueL( KMPXCommandGeneralDoSync, asyncBool ); + } + + /* + if( !aSync ) + { + iTransactions->NextTransactionId(); + + if( aCommandGeneralId == KVcxCommandIdMyVideos ) + { + cmd->SetTObjectValueL( KVcxMediaMyVideosTransactionId, iTransactions->TransactionId() ); + iTransactions->AddTransactionId( aMyVideosCommandId ); + } + } + + VCXLOGLO2("CVCXMyVideosCollectionPluginTester::CreateMpxCommandLC: collectionId: 0x%x", iCollectionUid.iUid); + */ + cmd->SetTObjectValueL( KMPXCommandGeneralCollectionId, iCollectionUid.iUid ); + + return cmd; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::FindAllL( CStifItemParser& /*aItem*/ ) + { + LogMethod(_L("FindAllL")); + TInt error( 0 ); + CMPXMedia* media = CMPXMedia::NewL(); + RArray array; + TRAP( error, iCollection->FindAllL(*media, array.Array()) ); + delete media; + array.Close(); + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::FindAllSyncL( CStifItemParser& /*aItem*/ ) + { + LogMethod(_L("FindAllSyncL")); + TInt error( 0 ); + CMPXMedia* media = CMPXMedia::NewL(); + RArray array; + TRAP( error, iCollection->FindAllSyncL( *media, array.Array() ) ); + delete media; + array.Close(); + + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::GetCapabilities( CStifItemParser& /*aItem*/ ) + { + LogMethod(_L("GetCapabilities")); + + TInt error( 0 ); + TCollectionCapability cap; + cap = iCollection->GetCapabilities(); + if( cap != EMcSearch ) + { + error = KErrCorrupt; + } + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::AddL( CStifItemParser& /*aItem*/ ) + { + LogMethod(_L("AddL")); + CMPXMedia* media = CMPXMedia::NewL(); + TRAPD( error, iCollection->AddL( *media ) ); + delete media; + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::RemoveL( CStifItemParser& /*aItem*/ ) + { + LogMethod(_L("RemoveL")); + CMPXMedia* media = CMPXMedia::NewL(); + TRAPD( error, iCollection->RemoveL( *media ) ); + delete media; + return error;; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::SetL( CStifItemParser& /*aItem*/ ) + { + LogMethod(_L("SetL")); + CMPXMedia* media = CMPXMedia::NewL(); + TRAPD( error, iCollection->SetL( *media ) ); // SetL is obsolete, so just set a null media + delete media; + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::HandleStepL( CStifItemParser& /*aItem*/ ) + { + LogMethod(_L("HandleStepL")); + TRAPD( error, iCollection->iActiveTask->RunL() ); + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::SetVideoListFetchingL( CStifItemParser& aItem ) + { + TInt value( KErrNotFound ); + aItem.GetNextInt( value ); + TBool enabled( value ); + TRAPD( error, iCollection->iMyVideosMdsDb->iVideoListFetchingIsOngoing = enabled ); + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::HandleMyVideosDbEvent( CStifItemParser& aItem ) + { + LogMethod(_L("HandleMyVideosDbEvent")); + + //CVcxMyVideosCollectionPlugin::HandleMyVideosDbEvent( + // TMPXChangeEventType aEvent, + // RArray& aId ) + + TMPXChangeEventType event; + + TInt eventEnum( 0 ); + aItem.GetNextInt( eventEnum ); + switch( eventEnum ) + { + case 1: + event = EMPXItemDeleted; + break; + case 2: + event = EMPXItemInserted; + break; + case 3: + event = EMPXItemModified; + break; + default: + break; + } + + //RArray ids; + RArray ids; + TInt id( 0 ); + while( aItem.GetNextInt( id ) == KErrNone ) + { + ids.Append( id ); + } + + TRAPD( error, iCollection->HandleMyVideosDbEvent( event, ids, 0 ) ); + + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::HandleCreateVideoListResp( CStifItemParser& aItem ) + { + LogMethod(_L("HandleCreateVideoListResp")); + + TInt complete( 0 ); + aItem.GetNextInt( complete ); + + TBool isComplete( (complete > 0 ) ? ETrue : EFalse ); + + TInt startIndex( 0 ); + aItem.GetNextInt( startIndex ); + + CMPXMedia* media = CMPXMedia::NewL(); + TRAPD( error, iCollection->HandleCreateVideoListResp(media, startIndex, isComplete) ); + delete media; + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::HandleObjectPresentNotificationL( CStifItemParser& aItem ) + { + LogMethod(_L("HandleObjectPresentNotification")); + + TInt cacheLeave( 0 ); + aItem.GetNextInt( cacheLeave ); + iCollection->iCache->iLeaveOnReset = (cacheLeave > 0) ? ETrue : EFalse; + TRAPD( error, iCollection->HandleObjectPresentNotification() ); + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::AddVideoToMdsAndCacheL( CStifItemParser& /*aItem*/ ) + { + LogMethod(_L("AddVideoToMdsAndCacheL")); + TRAPD( error, iCollection->AddVideoToMdsAndCacheL( *iMedia ) ); + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::SetVideoL( CStifItemParser& aItem ) + { + LogMethod(_L("SetVideoL")); + + TInt mpxid( 0 ); + aItem.GetNextInt( mpxid ); + + TInt type( 0 ); + aItem.GetNextInt( type ); + + TMPXItemId mpxId( mpxid, type ); + + CMPXMedia* media = CMPXMedia::NewL(); + CleanupStack::PushL( media ); + media->SetTObjectValueL( KMPXMediaGeneralId, mpxId ); + TRAPD( error, iCollection->SetVideoL( *media ) ); + CleanupStack::PopAndDestroy( media ); + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::SendMyVideosMessageL( CStifItemParser& aItem ) + { + LogMethod(_L("SendMyVideosMessageL")); + + //void CVcxMyVideosCollectionPlugin::SendMyVideosMessageL( + // TUint32 aMessageId, CMPXCommand* aCommand ) + + TInt msgId( 0 ); + aItem.GetNextInt( msgId ); + + CMPXCommand* cmd = NULL; + TInt createCommand( KErrNone ); + aItem.GetNextInt( createCommand ); + if( createCommand != KErrNone ) + { + cmd = CMPXCommand::NewL(); + } + + iCollection->SendMyVideosMessageL( (TUint32)msgId, cmd ); + + if( cmd ) + { + delete cmd; + } + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::SendMessages( CStifItemParser& /*aItem*/ ) + { + LogMethod(_L("SendMessages")); + + CMPXMessage* msg = CMPXMessage::NewL(); + /* + CleanupStack::PushL( msg ); + + CMPXMediaArray* mediaArray = CMPXMediaArray::NewL(); + CleanupStack::PushL( mediaArray ); + + TInt msgId( 0 ); + + while( aItem.GetNextInt( msgId ) == KErrNone ) + { + CMPXMessage* message = CMPXMessage::NewL(); + CleanupStack::PushL( message ); + + // Set message attributes + // + TMPXItemId itemId; + itemId.iId1 = KVcxCommandIdMyVideos; + message->SetTObjectValueL( KMPXMessageGeneralId, itemId ); + message->SetTObjectValueL( KVcxMediaMyVideosCommandId, msgId ); + mediaArray->AppendL( *message ); + CleanupStack::PopAndDestroy( message ); + } + //msg->SetCObjectValueL( KMPXMediaArrayContents, mediaArray ); + msg->SetCObjectValueL( KMPXMessageArrayContents, mediaArray ); + CleanupStack::PopAndDestroy( mediaArray ); + CleanupStack::Pop( msg ); + */ + iCollection->SendMessages( *msg ); + delete msg; + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::CategoriesL( CStifItemParser& aItem ) + { + LogMethod(_L("CategoriesL")); + + TInt error( 0 ); + TInt deleteCategories( 0 ); + aItem.GetNextInt( deleteCategories ); + if( deleteCategories ) + { + delete iCollection->iCategories; + } + TRAP( error, iCollection->CategoriesL() ); + + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::NotifyNewVideosCountDecreasedL( CStifItemParser& /*aItem*/ ) + { + LogMethod(_L("NotifyNewVideosCountDecreasedL")); + + TInt error( 0 ); + CMPXMedia* media = CMPXMedia::NewL(); + TRAP( error, iCollection->NotifyNewVideosCountDecreasedL( *media ) ); + delete media; + return error; + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +void CCollectionPluginTest::HandleMessage(CMPXMessage* aMsg, TInt /*aError*/) + { + // LOOK! WE HANDLE! + // TODO: lisää messagearray + + if ( aMsg->IsSupported( KMPXMessageArrayContents ) ) + { + const CMPXMessageArray* messageArray = + aMsg->Value(KMPXMessageArrayContents); + + for( TInt i = 0; i < messageArray->Count(); i++ ) + { + iMessageList->AppendL(*(messageArray->AtL( i ))); + } + } + else + { + iMessageList->AppendL( *aMsg ); + } + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +void CCollectionPluginTest::HandleOpen( CMPXMedia* /*aMedia*/, TInt /*aErr*/ ) + { + // LOOK! WE HANDLE! + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +void CCollectionPluginTest::HandleOpen(CMPXCollectionPath* /*aPath*/, TInt /*aErr*/ ) + { + // LOOK! WE HANDLE! + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// -----------------------------------------------------------------o------------ +// +void CCollectionPluginTest::HandleOpen( + CMPXMedia* /*aMedia*/, + const CMPXCollectionPath* /*aPath*/, + TInt /*aErr*/) + { + TInt a = 0; + a = a+1; + // LOOK! WE HANDLE! + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +void CCollectionPluginTest::HandleMedia( CMPXMedia* /*aMedia*/, TInt /*aError*/ ) + { + TInt a = 0; + a = a+1; + // LOOK! WE HANDLE! + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +void CCollectionPluginTest::HandleCommandComplete( CMPXCommand* /*aCommandResult*/, + TInt /*aError*/) + { + // LOOK! WE HANDLE! + Signal(); + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +void CCollectionPluginTest::HandleRemove( const CDesCArray& /*aUriArray*/, TInt /*aError*/ ) + { + // LOOK! WE HANDLE! + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +void CCollectionPluginTest::HandleFindAll( CMPXMedia* /*aMedia*/, TInt /*aError*/ ) + { + // LOOK! WE HANDLE! + } + +// ----------------------------------------------------------------------------- +// CCollectionPluginTest:: +// ----------------------------------------------------------------------------- +// +TInt CCollectionPluginTest::AlbumsL( CStifItemParser& aItem ) + { + LogMethod(_L("AlbumsL")); + + TInt error( 0 ); + TInt deleteAlbums( 0 ); + aItem.GetNextInt( deleteAlbums ); + if( deleteAlbums ) + { + delete iCollection->iAlbums; + } + + // Just check that iCollection->AlbumsL() doesn't leave + TRAP( error, iCollection->AlbumsL() ); + + return error; + } + +// [End of File] - Do not remove diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosactivetask_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosactivetask_stub.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,188 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Active object to split up long running db tasks* +*/ + + + +// INCLUDE FILES +#include +#include +#include "vcxmyvideosactivetask.h" + +// ============================ MEMBER FUNCTIONS ============================= + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +CVcxMyVideosActiveTask::CVcxMyVideosActiveTask( MVcxMyVideosActiveTaskObserver& aObserver ) : + CActive( CActive::EPriorityStandard ), + iObserver( aObserver ) + { + } + +// --------------------------------------------------------------------------- +// 2nd-phase constructor +// --------------------------------------------------------------------------- +// +void CVcxMyVideosActiveTask::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// Two-Phase Constructor +// --------------------------------------------------------------------------- +// +CVcxMyVideosActiveTask* CVcxMyVideosActiveTask::NewL( MVcxMyVideosActiveTaskObserver& aObserver ) + { + CVcxMyVideosActiveTask* self = new(ELeave) CVcxMyVideosActiveTask( aObserver); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CVcxMyVideosActiveTask::~CVcxMyVideosActiveTask() + { + Cancel(); + delete iCurCommand; + } + +// --------------------------------------------------------------------------- +// Start the operation +// --------------------------------------------------------------------------- +// +void CVcxMyVideosActiveTask::StartL( TMPXCommandId aTask, const CMPXCommand& aCommand ) + { + MPX_FUNC("CVcxMyVideosActiveTask::StartL"); + delete iCurCommand; + iCurCommand = NULL; + iCurCommand = CMPXMedia::NewL( aCommand ); + iCurTask = aTask; + iCurStep = 0; + } + +// --------------------------------------------------------------------------- +// Sets current command, unit test function +// --------------------------------------------------------------------------- +// +void CVcxMyVideosActiveTask::SetNewCommandL( const CMPXCommand& aCommand ) + { + delete iCurCommand; + iCurCommand = NULL; + iCurCommand = CMPXMedia::NewL( aCommand ); + } + +// --------------------------------------------------------------------------- +// Get the current step +// --------------------------------------------------------------------------- +// +TInt CVcxMyVideosActiveTask::GetStep() + { + return iCurStep; + } + +// --------------------------------------------------------------------------- +// Get the current task +// --------------------------------------------------------------------------- +// +TMPXCommandId CVcxMyVideosActiveTask::GetTask() + { + return iCurTask; + } + +// --------------------------------------------------------------------------- +// Get the current media +// --------------------------------------------------------------------------- +// +CMPXMedia& CVcxMyVideosActiveTask::GetCommand() + { + return *iCurCommand; + } + +// --------------------------------------------------------------------------- +// Get the current media +// --------------------------------------------------------------------------- +// +CMPXMedia* CVcxMyVideosActiveTask::Command() + { + return iCurCommand; + } + +// --------------------------------------------------------------------------- +// From CActive +// --------------------------------------------------------------------------- +// +void CVcxMyVideosActiveTask::RunL() + { + switch ( iObserver.HandleStepL() ) + { + case MVcxMyVideosActiveTaskObserver::EDone: + Done(); + break; + } + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosActiveTask::Done +// --------------------------------------------------------------------------- +// +void CVcxMyVideosActiveTask::Done() + { + iObserver.HandleOperationCompleted( KErrNone ); + delete iCurCommand; + iCurCommand = NULL; + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosActiveTask::ContinueStepping +// --------------------------------------------------------------------------- +// +void CVcxMyVideosActiveTask::ContinueStepping() + { + } + +void CVcxMyVideosActiveTask::Cancel() + { + if( iCurCommand ) + { + iObserver.HandleOperationCompleted( KErrCancel ); + delete iCurCommand; + iCurCommand = NULL; + } + } + +// --------------------------------------------------------------------------- +// From CActive +// --------------------------------------------------------------------------- +// +void CVcxMyVideosActiveTask::DoCancel() + { + } + +// --------------------------------------------------------------------------- +// From CActive +// --------------------------------------------------------------------------- +// +TInt CVcxMyVideosActiveTask::RunError( TInt /*aError*/ ) + { + return KErrNone; + } + +// END OF FILE diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosalbum_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosalbum_stub.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,206 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* + +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Class representing album in My Videos collection. +*/ + +#include +#include +#include +#include +#include +#include "vcxmyvideosalbum.h" +#include "vcxmyvideoscollectionplugin.h" +#include "vcxmyvideosvideocache.h" +#include "vcxmyvideoscollectionutil.h" + + +// --------------------------------------------------------------------------- +// TVcxMyVideosAlbumVideo::TVcxMyVideosAlbumVideo +// --------------------------------------------------------------------------- +// +TVcxMyVideosAlbumVideo::TVcxMyVideosAlbumVideo() + { + Set( 0, 0, 0 ); + } + +// --------------------------------------------------------------------------- +// TVcxMyVideosAlbumVideo::operator= +// --------------------------------------------------------------------------- +// +TVcxMyVideosAlbumVideo& TVcxMyVideosAlbumVideo::operator=( const TVcxMyVideosAlbumVideo& aVideo ) + { + Set( aVideo.iMdsId, aVideo.iRelationMdsId, aVideo.iMedia ); + return *this; + } + +// --------------------------------------------------------------------------- +// TVcxMyVideosAlbumVideo::Set +// --------------------------------------------------------------------------- +// +void TVcxMyVideosAlbumVideo::Set( TUint32 aMdsId, TUint32 aRelationMdsId, CMPXMedia* aVideo ) + { + iMdsId = aMdsId; + iRelationMdsId = aRelationMdsId; + iMedia = aVideo; + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosAlbum::CVcxMyVideosAlbum +// --------------------------------------------------------------------------- +// +CVcxMyVideosAlbum::CVcxMyVideosAlbum( CVcxMyVideosCollectionPlugin& aCollectionPlugin ) +: iCollection( aCollectionPlugin ) + { + // No implementation required + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosAlbum::~CVcxMyVideosAlbum +// --------------------------------------------------------------------------- +// +CVcxMyVideosAlbum::~CVcxMyVideosAlbum() + { + iVideoList.Close(); + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosAlbum::NewLC +// --------------------------------------------------------------------------- +// +CVcxMyVideosAlbum* CVcxMyVideosAlbum::NewLC( CVcxMyVideosCollectionPlugin& aCollectionPlugin ) + { + CVcxMyVideosAlbum* self = new (ELeave) CVcxMyVideosAlbum( aCollectionPlugin ); + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosAlbum::NewL +// --------------------------------------------------------------------------- +// +CVcxMyVideosAlbum* CVcxMyVideosAlbum::NewL( CVcxMyVideosCollectionPlugin& aCollectionPlugin ) + { + CVcxMyVideosAlbum* self = CVcxMyVideosAlbum::NewLC( aCollectionPlugin ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosAlbum::ConstructL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosAlbum::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosAlbum::Sort +// --------------------------------------------------------------------------- +// +void CVcxMyVideosAlbum::Sort() + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosAlbum::SetL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosAlbum::SetL( /*CMPXMedia& aAlbum*/ ) + { + //TODO: + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosAlbum::BelongsToAlbum +// --------------------------------------------------------------------------- +// +TBool CVcxMyVideosAlbum::BelongsToAlbum( TUint32 /*aMdsId*/ ) + { + return EFalse; + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosAlbum::Video +// --------------------------------------------------------------------------- +// +TInt CVcxMyVideosAlbum::Video( TUint32 /*aMdsId*/, TVcxMyVideosAlbumVideo& /*aVideo*/, TInt& /*aIndex*/ ) + { + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosAlbum::AddL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosAlbum::AddL( TVcxMyVideosAlbumVideo /*aVideo*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosAlbum::Remove +// --------------------------------------------------------------------------- +// +void CVcxMyVideosAlbum::Remove( RArray& /*aMdsIds*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosAlbum::Remove +// --------------------------------------------------------------------------- +// +void CVcxMyVideosAlbum::Remove( TUint32 /*aMdsId*/, TBool /*aCompress*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosAlbum::CompareVideosByMdsId +// --------------------------------------------------------------------------- +// +TInt CVcxMyVideosAlbum::CompareVideosByMdsId( const TVcxMyVideosAlbumVideo& /*aVideo1*/, + const TVcxMyVideosAlbumVideo& /*aVideo2*/ ) + { + return 0; + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosAlbum::CreateVideoListL +// Creates album video list from iCollection.iCache->iVideoList. +// --------------------------------------------------------------------------- +// +CMPXMedia* CVcxMyVideosAlbum::CreateVideoListL() + { + return NULL; + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosAlbum::CreateVideoListL +// Appends to video list the items which belong to this album. +// --------------------------------------------------------------------------- +// +void CVcxMyVideosAlbum::AppendToVideoListL( CMPXMedia& /*aFromVideoList*/, + CMPXMedia& /*aToVideoList*/, TInt /*aNewItemStartIndex*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosAlbum::CalculateAttributesL +// --------------------------------------------------------------------------- +// +TBool CVcxMyVideosAlbum::CalculateAttributesL() + { + return EFalse; + } + diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosalbums_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosalbums_stub.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,311 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Albums related collection functionality (except db operations). +* +*/ + + +// INCLUDE FILES +#include "vcxmyvideosalbums.h" +#include "vcxmyvideoscollectionplugin.h" + +const TInt KMPXIdNotFound = 998; + +// ============================ MEMBER FUNCTIONS ============================= + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +CVcxMyVideosAlbums::CVcxMyVideosAlbums( CVcxMyVideosCollectionPlugin& aCollection ) +: iCollection( aCollection ) + { + } + +// --------------------------------------------------------------------------- +// 2nd-phase constructor +// --------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::ConstructL() + { + iAlbums.Reset(); + iChangedAlbums.Reset(); + } + +// --------------------------------------------------------------------------- +// Two-Phase Constructor +// --------------------------------------------------------------------------- +// +CVcxMyVideosAlbums* CVcxMyVideosAlbums::NewL( CVcxMyVideosCollectionPlugin& aCollection ) + { + CVcxMyVideosAlbums* self = new(ELeave) CVcxMyVideosAlbums( aCollection ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CVcxMyVideosAlbums::~CVcxMyVideosAlbums() + { + delete iAlbumList; + TInt count = iAlbums.Count(); + for ( TInt i = 0; i < count; i++ ) + { + delete iAlbums[i]; + } + iAlbums.Close(); + iMdsOpTargetIds.Close(); + iMdsOpResults.Close(); + iMdsOpResultsUint32.Close(); + iRemoveFromAlbumVideos.Close(); + iChangedAlbums.Close(); + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::CreateAlbumListL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::CreateAlbumListL() + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::CreateAlbumsL +// Called when iAlbumList is ready, fills iAlbums. +// Pointers to CVcxMyVideosVideoCache::iVideoList are not filled in yet. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::CreateAlbumsL() + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::GetAlbumContentIdsL +// Fetches MDS IDs for all albums. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::GetAlbumContentIdsL() + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::Album +// ---------------------------------------------------------------------------- +// +CVcxMyVideosAlbum* CVcxMyVideosAlbums::Album( TUint32 /*aMdsId*/, TInt* /*aPos*/ ) + { + return NULL; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::AddVideosToAlbumL +// Command from MPX client. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::AddVideosToAlbumL( CMPXMedia* /*aCmd*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::RemoveVideosFromAlbumL +// Converts video mpx ids to relation ids and calls RemoveRelationsL. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::RemoveVideosFromAlbumL( CMPXMedia* /*aCmd*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::AddAlbumL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::AddAlbumL( CMPXMedia& /*aCmd*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::RemoveAlbumsFromMdsOnlyL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::RemoveAlbumsFromMdsOnlyL( CMPXMedia* /*aCmd*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::RemoveAlbumsL +// From MDS delete event. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::RemoveAlbumsL( RArray& /*aAlbumIds*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::RemoveAlbumL +// ---------------------------------------------------------------------------- +// +TBool CVcxMyVideosAlbums::RemoveAlbumL( TUint32 aMdsId, TBool /*aCompress*/ ) + { + return ( aMdsId == KMPXIdNotFound ) ? EFalse : ETrue; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::CalculateAttributesL +// ---------------------------------------------------------------------------- +// +TBool CVcxMyVideosAlbums::CalculateAttributesL() + { + return EFalse; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::AddAlbumsFromMdsL +// From MDS insert event, no need to fetch content since the album was just +// created. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::AddAlbumsFromMdsL( RArray& /*aAlbumIds*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::HandleGetAlbumsRespL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::HandleGetAlbumsRespL( CMPXMedia* /*aAlbumList*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::HandleGetAlbumContentIdsRespL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::HandleGetAlbumContentIdsRespL( TUint32 /*aAlbumId*/, + RArray& /*aAlbumContentIds*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::HandleGetAlbumsResp +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::HandleGetAlbumsResp( CMPXMedia* /*aAlbumList*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::HandleGetAlbumContentIdsResp +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::HandleGetAlbumContentIdsResp( TUint32 /*aAlbumId*/, + RArray& /*aAlbumContent*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::HandleAddVideosToAlbumResp +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::HandleAddVideosToAlbumResp( CMPXMedia* /*aCmd*/, + RPointerArray& /*aItemArray*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::DoHandleAddVideosToAlbumResp +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::DoHandleAddVideosToAlbumRespL( CMPXMedia* /*aCmd*/, + RPointerArray& /*aItemArray*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::HandleRemoveRelationsResp +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::HandleRemoveRelationsResp( RArray& /*aRelationIds*/, + RArray& /*aResults*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::HandleRemoveAlbumsResp +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::HandleRemoveAlbumsResp( CMPXMedia* /*aCmd*/, + RArray& /*aResultIds*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::HandleRelationEvent +// Only relation removed events are received here. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::HandleRelationEvent( TObserverNotificationType /*aType*/, + const RArray& /*aRelationArray*/ ) + { + } + +//HandleRelationIdEvent + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::UpdateAlbumL +// Updates album attributes from aAlbum, if album is not found from memory, +// nothing is done (no fetching from MDS). +// This func is also called (by MDS modified event) when items are added or +// removed from album. +// ---------------------------------------------------------------------------- +// +TBool CVcxMyVideosAlbums::UpdateAlbumL( const CMPXMedia& /*aAlbum*/ ) + { + return ETrue; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::NewVideoFlagChangedL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::NewVideoFlagChangedL( TUint32 /*aMdsId*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::VideoTitleChangedL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::VideoTitleChangedL( TUint32 /*aMdsId*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::VideoAddedOrRemovedFromCacheL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::VideoAddedOrRemovedFromCacheL( CMPXMedia& /*aVideo*/ ) + { + } +// ---------------------------------------------------------------------------- +// CVcxMyVideosAlbums::UpdateChangedAlbumsL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAlbums::UpdateChangedAlbumsL() + { + } +// END OF FILE diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosasyncfileoperations_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosasyncfileoperations_stub.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,161 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Implementation for MPX My Videos Collection Move, Copy and Delete operations.* +*/ + + + + +// INCLUDE FILES +#include "vcxmyvideoscollectionplugin.h" +#include "vcxmyvideosasyncfileoperations_stub.h" + +// ============================ MEMBER FUNCTIONS ============================== + +// ---------------------------------------------------------------------------- +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CVcxMyVideosAsyncFileOperations* CVcxMyVideosAsyncFileOperations::NewL( + CVcxMyVideosCollectionPlugin& aCollection ) + { + CVcxMyVideosAsyncFileOperations* self = new (ELeave) CVcxMyVideosAsyncFileOperations( + aCollection ); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// ---------------------------------------------------------------------------- +// Destructor. +// ---------------------------------------------------------------------------- +// +CVcxMyVideosAsyncFileOperations::~CVcxMyVideosAsyncFileOperations() + { + } + +// ---------------------------------------------------------------------------- +// Constructor. +// ---------------------------------------------------------------------------- +// +CVcxMyVideosAsyncFileOperations::CVcxMyVideosAsyncFileOperations( CVcxMyVideosCollectionPlugin& aCollection ) +: iCollection( aCollection ) + { + } + +// ---------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAsyncFileOperations::ConstructL () + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCollectionPlugin::DeleteVideoL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAsyncFileOperations::DeleteVideoL( TUint32 /*aMdsId*/, TBool /*aForce*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAsyncFileOperations::HandleMoveOrCopyStepL +// ---------------------------------------------------------------------------- +// +MVcxMyVideosActiveTaskObserver::TStepResult + CVcxMyVideosAsyncFileOperations::HandleMoveOrCopyStepL() + { + return MVcxMyVideosActiveTaskObserver::EDone; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAsyncFileOperations::InitMoveOrCopyOperationsL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAsyncFileOperations::InitMoveOrCopyOperationsL( CMPXMedia& /*aCmd*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAsyncFileOperations::CancelOperationL +// Called when leave or cancel occurs for the operation, generates resp msg. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAsyncFileOperations::CancelOperationL( TInt /*aErr*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAsyncFileOperations::SendOperationRespL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAsyncFileOperations::SendOperationRespL( TInt /*aCmdId*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAsyncFileOperations::MoveOrCopyVideoL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAsyncFileOperations::MoveOrCopyVideoL( TUint32 /*aMdsId*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAsyncFileOperations::InitSingleMoveOrCopyL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAsyncFileOperations::InitSingleMoveOrCopyL( TUint32 /*aMdsId*/ ) + { + } + + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAsyncFileOperations::HandleFileCopyCompletedL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAsyncFileOperations::HandleFileCopyCompletedL( TInt /*aErr*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAsyncFileOperations::DriveHasEnoughFreeSpaceL +// ---------------------------------------------------------------------------- +// +TBool CVcxMyVideosAsyncFileOperations::DriveHasEnoughFreeSpaceL( const TDesC& /*aPath*/, TInt /*aDrive*/ ) + { + return ETrue; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAsyncFileOperations::GenerateTargetPathForMoveOrCopyL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosAsyncFileOperations::GenerateTargetPathForMoveOrCopyL( + const TDesC& /*aSourcePath*/, TDes& /*aTargetPath*/, TInt /*aTargetDrive*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosAsyncFileOperations::HandleDeleteStepL +// ---------------------------------------------------------------------------- +// +MVcxMyVideosActiveTaskObserver::TStepResult CVcxMyVideosAsyncFileOperations::HandleDeleteStepL() + { + return MVcxMyVideosActiveTaskObserver::EDone; + } + + diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideoscategories_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideoscategories_stub.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,308 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Categories related functionality* +*/ + + + + +// INCLUDE FILES +#include +#include "vcxmyvideoscollectionplugin.h" +#include "vcxmyvideoscategories_stub.h" +#include "vcxmyvideoscollectionutil.h" + +// ============================ MEMBER FUNCTIONS ============================== + +// ---------------------------------------------------------------------------- +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CVcxMyVideosCategories* CVcxMyVideosCategories::NewL( + CVcxMyVideosCollectionPlugin& aCollection ) + { + CVcxMyVideosCategories* self = new (ELeave) CVcxMyVideosCategories( aCollection ); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// ---------------------------------------------------------------------------- +// Destructor. +// ---------------------------------------------------------------------------- +// +CVcxMyVideosCategories::~CVcxMyVideosCategories() + { + delete iList; + iModifiedCategories.Close(); + } + +// ---------------------------------------------------------------------------- +// Constructor. +// ---------------------------------------------------------------------------- +// +CVcxMyVideosCategories::CVcxMyVideosCategories( CVcxMyVideosCollectionPlugin& aCollection ) +: iCollection( aCollection ) + { + } + +// ---------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::ConstructL () + { + } + +// ---------------------------------------------------------------------------------------------------------- +// CVcxMyVideosCategories::CreateCategoryListL +// ---------------------------------------------------------------------------------------------------------- +// +CMPXMedia* CVcxMyVideosCategories::CreateCategoryListL() + { + return NULL; + } + +// ---------------------------------------------------------------------------------------------------------- +// CVcxMyVideosCategories::AppendCategoryToArrayL +// ---------------------------------------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::AppendCategoryToArrayL( const TDesC& /*aTitle*/, TMPXItemId /*aId*/, + CMPXMediaArray& /*aCategoryArray*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::UpdateCategoriesL +// Called by iCollection when fetching the video list from mds incrementally. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::UpdateCategoriesL( CMPXMedia& /*aVideoList*/, + TInt /*aNewItemsStartIndex*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::UpdateVideosCountL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::UpdateVideosCountL( CMPXMediaArray& /*aCategoryArray*/, + RArray& /*aVideosIncrements*/, RArray& /*aNewVideosIncrements*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::UpdateVideosCountL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::UpdateVideosCountL( CMPXMedia& /*aCategory*/, + TInt /*aIncrement*/, TMPXAttributeData /*aCountAttribute*/, TInt /*aEventInfo*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::VideosAddedL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::VideosAddedL( RArray& /*aIds*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::VideosRemovedL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::VideosRemovedL( RArray& /*aIds*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::VideoAddedL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::VideoAddedL( TUint32 /*aMdsId*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::VideoAddedL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::VideoAddedL( CMPXMedia& /*aVideo*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::VideoRemovedL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::VideoRemovedL( TUint32 /*aMdsId*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::VideoRemovedL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::VideoRemovedL( CMPXMedia& /*aVideo*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::VideosAddedOrRemovedL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::VideosAddedOrRemovedL( + RArray& /*aIds*/, TBool /*aAdded*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::VideoAddedOrRemovedL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::VideoAddedOrRemovedL( TUint32 /*aMdsId*/, TBool /*aAdded*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::VideoAddedOrRemovedL +// All remove&add calls eventually come here. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::VideoAddedOrRemovedL( CMPXMedia& /*aVideo*/, TBool /*aAdded*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::UpdateCategoryL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::UpdateCategoryL( CMPXMedia& /*aCategory*/, TInt /*aCategoryIndex*/, + CMPXMedia& /*aVideo*/, TBool /*aAdded*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::AddToTUint32AttributeL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::AddToTUint32AttributeL( CMPXMedia& /*aCategory*/, TInt /*aAddition*/, + TMPXAttributeData /*aAttribute*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::CategoryIndex +// ---------------------------------------------------------------------------- +// +TInt CVcxMyVideosCategories::CategoryIndex( TInt /*aOrigin*/ ) + { + return 0; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::NewVideoFlagChangedL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::NewVideoFlagChangedL( TUint32 /*aOldFlag*/, TUint32 /*aNewFlag*/, + TUint8 /*aOrigin*/, TBool& /*aModified*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::ResetVideoCountersL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::ResetVideoCountersL() + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::UpdateCategoriesNewVideoNamesL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::UpdateCategoriesNewVideoNamesL() + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::UpdateCategoryNewVideoNameAndDateL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::UpdateCategoryNewVideoNameAndDateL( TInt /*aOrigin*/, TBool& /*aModified*/, + RArray& /*aIgnoredIds*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::CalculateNewVideoNameL +// ---------------------------------------------------------------------------- +// +const TDesC& CVcxMyVideosCategories::CalculateNewVideoNameL( CMPXMedia& /*aVideoList*/, + TInt /*aOrigin*/, RArray& /*aIgnoredIds*/, CMPXMedia*& /*aNewVideo*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::UpdateCategoryNewVideoNameAndDateL +// Called when video is updated in a way that it affects category new +// video name. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::UpdateCategoryNewVideoNameAndDateL( CMPXMedia& /*aVideo*/, + TBool& /*aModified*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::GenerateCategoryModifiedEventL +// Called when video is updated in a way that it modifies categories in a way +// that event is sent. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::GenerateCategoryModifiedEventL( CMPXMedia& /*aMedia*/, + TBool /*aFlushMessageList*/, TInt32 /*aExtraInfo*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::OriginChangedL +// Called when videos origin is changed (Video moves from one category to other). +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::OriginChangedL( CMPXMedia& /*aVideo*/, TUint8 /*aPrevOrigin*/, + TUint8 /*aNewOrigin*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::ResetModifiedCategoriesArray +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::ResetModifiedCategoriesArray() + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCategories::AddEventsFromModifiedCategoriesArrayL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosCategories::AddEventsFromModifiedCategoriesArrayL() + { + } + +// End of file + diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideoscollectionutil_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideoscollectionutil_stub.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,567 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef _DEBUG +#include +#include +#endif +#include "vcxmyvideoscollectionutil.h" + +// ============================ MEMBER FUNCTIONS ============================== + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCollectionUtil::CreateEmptyMediaListL +// ---------------------------------------------------------------------------- +// +CMPXMedia* TVcxMyVideosCollectionUtil::CreateEmptyMediaListL() + { + RArray supportedIds; + CleanupClosePushL( supportedIds ); // 1-> + + supportedIds.AppendL( KMPXMediaIdContainer ); + supportedIds.AppendL( KMPXMediaIdGeneral ); + + //create container + CMPXMedia* container = CMPXMedia::NewL( supportedIds.Array() ); + CleanupStack::PushL( container ); // 2-> + + CMPXMediaArray* mediaArray = CMPXMediaArray::NewL(); + CleanupStack::PushL( mediaArray ); // 3-> + + container->SetCObjectValueL( KMPXMediaArrayContents, mediaArray ); + + CleanupStack::PopAndDestroy( mediaArray ); // <-3 + CleanupStack::Pop( container ); // <-2 + CleanupStack::PopAndDestroy( &supportedIds ); // <-1 + return container; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosCollectionUtil::CreateEmptyMessageListL +// ---------------------------------------------------------------------------- +// +CMPXMedia* TVcxMyVideosCollectionUtil::CreateEmptyMessageListL() + { + RArray supportedIds; + CleanupClosePushL( supportedIds ); // 1-> + + supportedIds.AppendL( KMPXMediaIdContainer ); + + //create container + CMPXMedia* container = CMPXMedia::NewL( supportedIds.Array() ); + CleanupStack::PushL( container ); // 2-> + + CMPXMediaArray* messageArray = CMPXMediaArray::NewL(); + CleanupStack::PushL( messageArray ); // 3-> + + container->SetCObjectValueL( KMPXMessageArrayContents, messageArray ); + + CleanupStack::PopAndDestroy( messageArray ); // <-3 + CleanupStack::Pop( container ); // <-2 + CleanupStack::PopAndDestroy( &supportedIds ); // <-1 + return container; + } + +// --------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::CopyFromListToListL +// --------------------------------------------------------------------------- +// +void TVcxMyVideosCollectionUtil::CopyFromListToListL( + CMPXMedia& aFromList, + CMPXMedia& aToList, + RArray& aMdsIds ) + { + MPX_FUNC("TVcxMyVideosCollectionUtil::CopyFromListToListL ()"); + + if ( !aFromList.IsSupported( KMPXMediaArrayContents ) || + !aToList.IsSupported( KMPXMediaArrayContents ) ) + { + MPX_DEBUG1("TVcxMyVideosCollectionUtil::CopyFromListToListL left, media array(s) missing. "); + User::Leave( KErrArgument ); + } + + TInt mdsIdsCount = aMdsIds.Count(); + CMPXMediaArray* fromArray = aFromList.Value( KMPXMediaArrayContents ); + CMPXMediaArray* toArray = aToList.Value( KMPXMediaArrayContents ); + TInt fromArrayCount = fromArray->Count(); + TMPXItemId fromId; + TMPXItemId toId; + + for ( TInt i = 0; i < mdsIdsCount; i++ ) + { + for ( TInt j = 0; j < fromArrayCount; j++ ) + { + if ( aMdsIds[i] == + fromArray->AtL( j )->ValueTObjectL( KMPXMediaGeneralId ).iId1 ) + { + toArray->AppendL( *fromArray->AtL( j ) ); + MPX_DEBUG3("TVcxMyVideosCollectionUtil:: copying %d (from pointer %x)", aMdsIds[i], fromArray->AtL( j )); + break; + } + } + } + } + +// --------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::CopyFromListToListL +// --------------------------------------------------------------------------- +// +void TVcxMyVideosCollectionUtil::CopyFromListToListL( + RArray& aFromArray, + CMPXMedia& aToList, + RArray& aMdsIds ) + { + MPX_FUNC("TVcxMyVideosCollectionUtil::CopyFromListToListL( RArray version )"); + + if ( !aToList.IsSupported( KMPXMediaArrayContents ) ) + { + MPX_DEBUG1("TVcxMyVideosCollectionUtil::CopyFromListToListL left, media array missing. "); + User::Leave( KErrArgument ); + } + + TInt mdsIdsCount = aMdsIds.Count(); + CMPXMediaArray* toArray = aToList.Value( KMPXMediaArrayContents ); + TInt fromArrayCount = aFromArray.Count(); + TMPXItemId fromId; + TMPXItemId toId; + + for ( TInt i = 0; i < mdsIdsCount; i++ ) + { + for ( TInt j = 0; j < fromArrayCount; j++ ) + { + if ( aMdsIds[i] == + aFromArray[j]->ValueTObjectL( KMPXMediaGeneralId ).iId1 ) + { + toArray->AppendL( *aFromArray[j] ); + MPX_DEBUG3("TVcxMyVideosCollectionUtil:: copying %d (from pointer %x)", aMdsIds[i], aFromArray[j]); + break; + } + } + } + } + +// --------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::AppendToListL +// New items in aToList will point to same shared memory as items in aFromList. +// --------------------------------------------------------------------------- +// +void TVcxMyVideosCollectionUtil::AppendToListL( CMPXMedia& aToList, CMPXMedia& aFromList ) + { + CMPXMedia* media; + CMPXMediaArray* toArray = aToList.Value( KMPXMediaArrayContents ); + CMPXMediaArray* fromArray = aFromList.Value( KMPXMediaArrayContents ); + TInt count = fromArray->Count(); + for ( TInt i = 0; i < count; i++ ) + { + media = CMPXMedia::NewL( *(fromArray->AtL( i )) ); // points to same shared memory + toArray->AppendL( media ); //ownership moves + } + } + +// --------------------------------------------------------------------------- +// This helper function converts drive letter to drive number +// --------------------------------------------------------------------------- +// +TInt TVcxMyVideosCollectionUtil::DriveLetter2DriveNumber( const TDesC &aDrive ) + { + TInt retVal = KErrArgument; + + if (aDrive.Length() > 0) + { + TChar letter = aDrive[0]; + letter.UpperCase(); + if (letter >= 'A' && letter <= 'Z') + { + retVal = (TInt)letter - 'A'; + } + } + + return retVal; + } + +// --------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::MakeUniqueFileNameL +// --------------------------------------------------------------------------- +// +void TVcxMyVideosCollectionUtil::MakeUniqueFileNameL( RFs& aFs, const TDesC& aPath, + TDes& aUniquePath ) + { + const TInt KMaxDigits = 7; + TBuf counterDigits; + + aUniquePath = aPath; + TInt counter = 1; + //TInt zeros = 0; + TInt pos = 0; + while( BaflUtils::FileExists( aFs, aUniquePath ) ) + { + pos = aPath.Locate( '.' ); + if ( pos == KErrNotFound ) + { + aUniquePath = aPath; + } + else + { + aUniquePath = aPath.Mid( 0, pos ); + } + _LIT(KPercentD, "%d"); + counterDigits.Format( KPercentD, counter++ ); + aUniquePath.Append( '_' ); + aUniquePath.Append( '(' ); + aUniquePath.AppendJustify( counterDigits, KMaxDigits, TAlign( ERight ), '0' ); + aUniquePath.Append( ')' ); + if ( pos != KErrNotFound ) + { + aUniquePath.Append( aPath.Mid( pos ) ); + } + } + } + +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::OriginL +// ---------------------------------------------------------------------------- +// +TUint8 TVcxMyVideosCollectionUtil::OriginL( CMPXMedia& aVideo ) + { + TUint8 origin = EVcxMyVideosOriginOther; + + if ( aVideo.IsSupported( KVcxMediaMyVideosOrigin ) ) + { + origin = aVideo.ValueTObjectL( KVcxMediaMyVideosOrigin ); +#ifndef VCX_DOWNLOADS_CATEGORY + if ( origin != EVcxMyVideosOriginCapturedWithCamera ) + { + origin = EVcxMyVideosOriginOther; + } +#else + if ( origin != EVcxMyVideosOriginCapturedWithCamera && + origin != EVcxMyVideosOriginDownloaded + ) + { + origin = EVcxMyVideosOriginOther; + } +#endif + } + return origin; + } + +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::FlagsL +// ---------------------------------------------------------------------------- +// +TUint32 TVcxMyVideosCollectionUtil::FlagsL( CMPXMedia& aVideo ) + { + TUint32 flags = 0; + + if ( aVideo.IsSupported( KMPXMediaGeneralFlags ) ) + { + flags = aVideo.ValueTObjectL( KMPXMediaGeneralFlags ); + } + return flags; + } + +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::CreationDateL +// ---------------------------------------------------------------------------- +// +TInt64 TVcxMyVideosCollectionUtil::CreationDateL( CMPXMedia& aVideo ) + { + TInt64 creationDate = 0; + + if ( aVideo.IsSupported( KMPXMediaGeneralDate ) ) + { + creationDate = aVideo.ValueTObjectL( KMPXMediaGeneralDate ); + } + return creationDate; + } + +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::DownloadIdL +// ---------------------------------------------------------------------------- +// +TUint32 TVcxMyVideosCollectionUtil::DownloadIdL( CMPXMedia& aVideo ) + { + TUint32 downloadId = 0; + + if ( aVideo.IsSupported( KVcxMediaMyVideosDownloadId ) ) + { + downloadId = aVideo.ValueTObjectL( KVcxMediaMyVideosDownloadId ); + } + return downloadId; + } + +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::DownloadStateL +// ---------------------------------------------------------------------------- +// +TVcxMyVideosDownloadState TVcxMyVideosCollectionUtil::DownloadStateL( CMPXMedia& aVideo ) + { + TVcxMyVideosDownloadState downloadState = EVcxMyVideosDlStateNone; + + if ( aVideo.IsSupported( KVcxMediaMyVideosDownloadState ) ) + { + downloadState = static_cast( + aVideo.ValueTObjectL( KVcxMediaMyVideosDownloadState ) ); + } + return downloadState; + } + +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::IdL +// ---------------------------------------------------------------------------- +// +TMPXItemId TVcxMyVideosCollectionUtil::IdL( const CMPXMedia& aVideo ) + { + TMPXItemId id( 0, 0 ); + + if ( aVideo.IsSupported( KMPXMediaGeneralId ) ) + { + id = aVideo.ValueTObjectL( KMPXMediaGeneralId ); + } + return id; + } + + + +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::DurationL +// ---------------------------------------------------------------------------- +// +TReal32 TVcxMyVideosCollectionUtil::DurationL( CMPXMedia& aVideo ) + { + TReal32 duration = -1; + + if ( aVideo.IsSupported( KVcxMediaMyVideosDuration ) ) + { + duration = aVideo.ValueTObjectL( KVcxMediaMyVideosDuration ); + } + return duration; + } + + +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::Title +// ---------------------------------------------------------------------------- +// +const TDesC& TVcxMyVideosCollectionUtil::Title( const CMPXMedia& aVideo ) + { + if ( aVideo.IsSupported( KMPXMediaGeneralTitle ) ) + { + return aVideo.ValueText( KMPXMediaGeneralTitle ); + } + else + { + return KNullDesC; + } + } + +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::RatingL +// ---------------------------------------------------------------------------- +// +TUint8 TVcxMyVideosCollectionUtil::RatingL( CMPXMedia& aVideo ) + { + TUint8 rating = 0; + + if ( aVideo.IsSupported( KVcxMediaMyVideosRating ) ) + { + rating = aVideo.ValueTObjectL( KVcxMediaMyVideosRating ); + } + return rating; + } + +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::AudioFourCcL +// ---------------------------------------------------------------------------- +// +TUint32 TVcxMyVideosCollectionUtil::AudioFourCcL( CMPXMedia& aVideo ) + { + TUint32 audioFourCc = 0; + + if ( aVideo.IsSupported( KVcxMediaMyVideosAudioFourCc ) ) + { + audioFourCc = aVideo.ValueTObjectL( KVcxMediaMyVideosAudioFourCc ); + } + return audioFourCc; + } + +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::AreSupported +// ---------------------------------------------------------------------------- +// +TBool TVcxMyVideosCollectionUtil::AreSupported( CMPXMedia& aVideo, + const TArray& aAttrs, + TBool& aNonSupportedAttrCanBeFoundFromMds ) + { + MPX_FUNC("TVcxMyVideosCollectionUtil::AreSupported()"); + + TBool areSupported( ETrue ); + aNonSupportedAttrCanBeFoundFromMds = EFalse; + + for ( TInt i = 0; i < aAttrs.Count(); i++ ) + { + if ( !aVideo.IsSupported( aAttrs[i] ) ) + { + MPX_DEBUG3(" attr (%x)(%x) not supported in media object", aAttrs[i].ContentId(), + aAttrs[i].AttributeId() ); + + areSupported = EFalse; + + if ( AttrBelongsToFullSet( aAttrs[i] ) ) + { + MPX_DEBUG1(" attr can be found from mds"); + aNonSupportedAttrCanBeFoundFromMds = ETrue; + return areSupported; // We can return since areSupported and aNonSupportedAttrCanBeFoundFromMds + // won't change anymore, no matter what rest of the attributes are. + // Fetching from MDS is justified. + } + else + { + MPX_DEBUG1(" attr can NOT be found from mds"); + } + } + } + + return areSupported; + } + +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::AttrBelongsToFullSet +// ---------------------------------------------------------------------------- +// +TBool TVcxMyVideosCollectionUtil::AttrBelongsToFullSet( const TMPXAttribute& aAttr ) + { + // these attributes are saved to MDS but not to cache. + if ( aAttr == KMPXMediaGeneralComment || + aAttr == KMPXMediaGeneralCopyright || + aAttr == KMPXMediaGeneralMimeType || + aAttr == KMPXMediaGeneralLastPlaybackPosition || + aAttr == KVcxMediaMyVideosModifiedDate || + aAttr == KVcxMediaMyVideosAudioLanguage || + aAttr == KVcxMediaMyVideosAuthor || + aAttr == KMPXMediaVideoBitRate || + aAttr == KMPXMediaVideoHeight || + aAttr == KMPXMediaVideoWidth || + aAttr == KMPXMediaVideoArtist ) + { + return ETrue; + } + return EFalse; + } + +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::Origin +// ---------------------------------------------------------------------------- +// +TInt TVcxMyVideosCollectionUtil::Origin( TInt /*aCategoryId*/ ) + { + return 0; + } + +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::MediaArrayL +// ---------------------------------------------------------------------------- +// +CMPXMediaArray* TVcxMyVideosCollectionUtil::MediaArrayL( const CMPXMedia& /*aMedia*/ ) + { + return NULL; + } + +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::Int32ValueL +// ---------------------------------------------------------------------------- +// +TInt32 TVcxMyVideosCollectionUtil::Int32ValueL( CMPXMedia& /*aMedia*/ ) + { + return 0; + } + +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::Uint32ValueL +// ---------------------------------------------------------------------------- +// +TUint32 TVcxMyVideosCollectionUtil::Uint32ValueL( CMPXMedia& /*aMedia*/ ) + { + return 0; + } + +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::CategoryItemCountL +// ---------------------------------------------------------------------------- +// +TUint32 TVcxMyVideosCollectionUtil::CategoryItemCountL( CMPXMedia& /*aVideo*/ ) + { + return 0; + } + +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::CategoryNewItemCountL +// ---------------------------------------------------------------------------- +// +TUint32 TVcxMyVideosCollectionUtil::CategoryNewItemCountL( CMPXMedia& /*aVideo*/ ) + { + return 0; + } + +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::CategoryNewVideoName +// ---------------------------------------------------------------------------- +// +const TDesC& TVcxMyVideosCollectionUtil::CategoryNewVideoName( const CMPXMedia& /*aVideo*/ ) + { + } + +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::GetIdsFromMediaArrayL +// ---------------------------------------------------------------------------- +// +void TVcxMyVideosCollectionUtil::GetIdsFromMediaArrayL( CMPXMediaArray& /*aMediaArray*/, + RArray& /*aIdArray*/ ) + { + } + +#ifdef _DEBUG +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::PrintOpenFileHandlesL +// ---------------------------------------------------------------------------- +// +void TVcxMyVideosCollectionUtil::PrintOpenFileHandlesL( const TDesC& /*aFileName*/, RFs& /*aFs*/ ) + { + } + +// ---------------------------------------------------------------------------- +// TVcxMyVideosCollectionUtil::GetProcessName +// ---------------------------------------------------------------------------- +// +void TVcxMyVideosCollectionUtil::GetProcessName( TInt /*aThreadId*/, TFullName& /*aProcessName*/ ) + { + } +#endif + +// End of file diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosmdsalbums_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosmdsalbums_stub.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,364 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Provides albums support utilizing MDS. +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include "vcxmyvideosmdsalbums.h" +#include "vcxmyvideosmdsdb_stub.h" +#include "vcxmyvideoscollectionutil.h" + +// ============================ MEMBER FUNCTIONS ============================= + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +CVcxMyVideosMdsAlbums::CVcxMyVideosMdsAlbums( CVcxMyVideosMdsDb& aMdsDb, + MVcxMyVideosMdsAlbumsObserver* aObserver ) +: CActive( EPriorityStandard ), iMdsDb( aMdsDb ), iObserver(aObserver) + { + } + +// --------------------------------------------------------------------------- +// 2nd-phase constructor +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::ConstructL() + { + GetSchemaDefinitionsL(); + SetObservingL(); + //CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// Two-Phase Constructor +// --------------------------------------------------------------------------- +// +CVcxMyVideosMdsAlbums* CVcxMyVideosMdsAlbums::NewL( CVcxMyVideosMdsDb& aMdsDb, + MVcxMyVideosMdsAlbumsObserver* aObserver ) + { + CVcxMyVideosMdsAlbums* self = new(ELeave) CVcxMyVideosMdsAlbums( aMdsDb, aObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CVcxMyVideosMdsAlbums::~CVcxMyVideosMdsAlbums() + { + CancelQueries(); + delete iAlbumQuery; + delete iVideoQuery; + delete iRelationQuery; + iItemArray.Close(); + iResultBuffer.Close(); + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::CancelQueries +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::CancelQueries( CVcxMyVideosMdsDb::TRequestType /*aType*/ ) + { + } + +// --------------------------------------------------------------------------- +// From CActive +// CVcxMyVideosMdsAlbums::DoCancel +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::DoCancel() + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::SetObservingL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::SetObservingL() + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::GetAlbumsL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::GetAlbumsL( CMPXMedia* /*aAlbumList*/, + MVcxMyVideosMdsAlbumsObserver& /*aClient*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::GetAlbumL +// --------------------------------------------------------------------------- +// +CMPXMedia* CVcxMyVideosMdsAlbums::GetAlbumL( TUint32 /*aId*/ ) + { + return NULL; + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::DoGetAlbumsL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::DoGetAlbumsL( CMPXMedia* /*aAlbumList*/, + MVcxMyVideosMdsAlbumsObserver& /*aClient*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::GetAlbumContentIdsL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::GetAlbumContentIdsL( TUint32 /*aAlbumId*/, + RArray& /*aContentArray*/, + MVcxMyVideosMdsAlbumsObserver& /*aClient*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::DoGetAlbumContentIdsL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::DoGetAlbumContentIdsL( TUint32 /*aAlbumId*/, + RArray& /*aContentArray*/, + MVcxMyVideosMdsAlbumsObserver& /*aClient*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::GetAlbumContentVideosL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::GetAlbumContentVideosL( TUint32 /*aAlbumId*/, CMPXMedia& /*aVideoList*/, + MVcxMyVideosMdsAlbumsObserver& /*aClient*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::DoGetAlbumContentVideosL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::DoGetAlbumContentVideosL( TUint32 /*aAlbumId*/, CMPXMedia& /*aVideoList*/, + MVcxMyVideosMdsAlbumsObserver& /*aClient*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::GetSchemaDefinitionsL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::GetSchemaDefinitionsL() + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::Object2MediaL +// For album objects only. +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::Object2MediaL( + CMdEObject& /*aObject*/, + CMPXMedia& /*aAlbum*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::Media2ObjectL +// Called by AddAlbumL() +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::Media2ObjectL( + CMPXMedia& /*aAlbum*/, + CMdEObject& /*aObject*/) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::GetSchemaDefinitionsL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::HandleQueryNewResults(CMdEQuery& /*aQuery*/, + TInt /*aFirstNewItemIndex*/, + TInt /*aNewItemCount*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::HandleQueryCompleted +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::HandleQueryCompleted( CMdEQuery& /*aQuery*/, TInt /*aError*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::HandleAlbumQueryCompletedL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::HandleAlbumQueryCompletedL( CMdEQuery& /*aQuery*/, TInt /*aError*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::HandleVideoQueryCompletedL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::HandleVideoQueryResultsL( CMdEQuery& /*aQuery*/, TInt /*aError*/, + TInt /*aFirstNewItemIndex*/, TInt /*aNewItemCount*/, TBool /*aComplete*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::HandleRelationQueryCompletedL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::HandleRelationQueryCompletedL( CMdEQuery& /*aQuery*/, TInt /*aError*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::AddVideosToAlbumL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::AddVideosToAlbumL( CMPXMedia* /*aCmd*/, + MVcxMyVideosMdsAlbumsObserver& /*aClient*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::DoAddVideosToAlbumL +// Called by iMdsDb.iCmdQueue +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::DoAddVideosToAlbumL( CMPXMedia* /*aCmd*/, + MVcxMyVideosMdsAlbumsObserver& /*aClient*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::RemoveRelationsL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::RemoveRelationsL( RArray& /*aRelationIds*/, + RArray& /*aResults*/, MVcxMyVideosMdsAlbumsObserver& /*aClient*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::DoRemoveRelationsL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::DoRemoveRelationsL( RArray& /*aRelationIds*/, + RArray& /*aResults*/, MVcxMyVideosMdsAlbumsObserver& /*aClient*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::AddAlbumL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::AddAlbumL( CMPXMedia& /*aAlbum*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::SetAlbumL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::SetAlbumL( CMPXMedia& /*aVideo*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::RemoveAlbumsL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::RemoveAlbumsL( CMPXMedia* /*aMpxCmd*/, MVcxMyVideosMdsAlbumsObserver& /*aClient*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::DoRemoveAlbumsL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::DoRemoveAlbumsL( CMPXMedia* /*aMpxCmd*/, + MVcxMyVideosMdsAlbumsObserver& /*aClient*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::RunL +// From CActive. +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::RunL() + { + } + +//TODO: implement RunError + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::HandleAddVideosToAlbumCompletedL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::HandleAddVideosToAlbumCompletedL() + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::HandleRemoveRelationsCompletedL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::HandleRemoveRelationsCompletedL() + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::HandleRemoveAlbumsCompletedL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::HandleRemoveAlbumsCompletedL() + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosMdsAlbums::HandleRelationItemNotification +// From MMdERelationItemObserver +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosMdsAlbums::HandleRelationItemNotification(CMdESession& /*aSession*/, + TObserverNotificationType aType, + const RArray& aRelationArray) + { + if ( iObserver ) + { + iObserver->HandleRelationEvent( aType, aRelationArray ); + } + } + +// END OF FILE diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosmdsdb_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosmdsdb_stub.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,430 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: MPX My Videos collection plugin's MDS database class* +*/ + + + + +//#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "vcxmyvideosmdsdb_stub.h" +#include "vcxmyvideoscollectionutil.h" + + +const TInt KInvalidId( -100 ); +const TInt KMPXIdNotFound( 998 ); + +// --------------------------------------------------------------------------- +// CVcxMdsShutdownMonitor::NewL() +// --------------------------------------------------------------------------- +// +CVcxMdsShutdownMonitor* CVcxMdsShutdownMonitor::NewL( MVcxMdsShutdownMonitorObserver& aObserver, + const TUid& aKeyCategory, + const TInt aPropertyKey, + TBool aDefineKey) + { + CVcxMdsShutdownMonitor* self = new( ELeave )CVcxMdsShutdownMonitor( aObserver, + aKeyCategory, + aPropertyKey, + aDefineKey); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// CVcxMdsShutdownMonitor::CVcxMdsShutdownMonitor() +// --------------------------------------------------------------------------- +// +CVcxMdsShutdownMonitor::CVcxMdsShutdownMonitor( MVcxMdsShutdownMonitorObserver& aObserver, + const TUid& aKeyCategory, + const TInt aPropertyKey, + TBool aDefineKey) + : CActive( CActive::EPriorityStandard ), iObserver( aObserver ), + iKeyCategory( aKeyCategory ), iPropertyKey(aPropertyKey), iDefineKey( aDefineKey ) + { + CActiveScheduler::Add( this ); + } + +// --------------------------------------------------------------------------- +// CVcxMdsShutdownMonitor::ConstructL() +// --------------------------------------------------------------------------- +// +void CVcxMdsShutdownMonitor::ConstructL() + { + } + +// --------------------------------------------------------------------------- +// CVcxMdsShutdownMonitor::~CVcxMdsShutdownMonitor() +// --------------------------------------------------------------------------- +// +CVcxMdsShutdownMonitor::~CVcxMdsShutdownMonitor() + { + } + +// --------------------------------------------------------------------------- +// CVcxMdsShutdownMonitor::RunL() +// --------------------------------------------------------------------------- +// +void CVcxMdsShutdownMonitor::RunL() + { + } + +// --------------------------------------------------------------------------- +// CVcxMdsShutdownMonitor::DoCancel() +// --------------------------------------------------------------------------- +// +void CVcxMdsShutdownMonitor::DoCancel() + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::CVcxMyVideosMdsDb +// --------------------------------------------------------------------------- +// +CVcxMyVideosMdsDb::CVcxMyVideosMdsDb( MVcxMyVideosMdsDbObserver* aObserver, + RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver ) +: iFs( aFs ), iMdsDbObserver(aObserver), iAlbumsObserver(aAlbumsObserver) + { + } + + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::ConstructL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsDb::ConstructL() + { + //iCmdQueue = CVcxMyVideosMdsCmdQueue::NewL( *this ); + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::OpenMdsSessionL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsDb::OpenMdsSessionL() + { + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsDb::HandleObjectPresentNotification( CMdESession& /*aSession*/, + TBool /*aPresent*/, const RArray& /*aObjectIdArray*/) + { + } + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +CVcxMyVideosMdsDb* CVcxMyVideosMdsDb::NewL( MVcxMyVideosMdsDbObserver* aObserver, + RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver ) + { + CVcxMyVideosMdsDb* self = + CVcxMyVideosMdsDb::NewLC( aObserver, aFs, aAlbumsObserver ); + CleanupStack::Pop( self ); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +CVcxMyVideosMdsDb* CVcxMyVideosMdsDb::NewLC( MVcxMyVideosMdsDbObserver* aObserver, + RFs& aFs, MVcxMyVideosMdsAlbumsObserver* aAlbumsObserver ) + { + CVcxMyVideosMdsDb* self = new( ELeave ) CVcxMyVideosMdsDb( aObserver, aFs, aAlbumsObserver ); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + + +// --------------------------------------------------------------------------- +// --------------------------------------------------------------------------- +// +CVcxMyVideosMdsDb::~CVcxMyVideosMdsDb() + { + delete iVideoQuery; + delete iMdsSession; + delete iActiveSchedulerWait; + delete iAsyncHandleQueryCompleteCaller; + delete iMdsShutdownMonitor; + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::Cancel +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsDb::Cancel( TRequestType /*aType*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::AddVideoL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsDb::AddVideoL( + CMPXMedia& /*aVideo*/, + TUint32& /*aMdsId*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::RemoveVideo +// --------------------------------------------------------------------------- +// +TInt CVcxMyVideosMdsDb::RemoveVideo( TUint32 /*aMdsId*/ ) + { + return 0; + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::UpdateVideoL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsDb::UpdateVideoL( CMPXMedia& /*aVideo*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::CreateVideoListL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsDb::CreateVideoListL( TVcxMyVideosSortingOrder /*aSortingOrder*/, + TBool /*aAscending*/, TBool /*aFullDetails*/, CMPXMedia*& /*aVideoList*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::DoCreateVideoListL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsDb::DoCreateVideoListL( TVcxMyVideosSortingOrder /*aSortingOrder*/, + TBool /*aAscending*/, TBool /*aFullDetails*/, CMPXMedia*& aVideoList ) + { + iVideoList = aVideoList; + CMPXMediaArray* mediaArray = iVideoList->Value(KMPXMediaArrayContents); + CleanupStack::PushL( mediaArray ); + for( TInt i = 0; i < 10; i++ ) + { + TMPXItemId mpxId( i, 0 ); + + CMPXMedia* newMedia = CMPXMedia::NewL(); + CleanupStack::PushL( newMedia ); + newMedia->SetTObjectValueL( KMPXMessageMediaGeneralId, mpxId ); + newMedia->SetTObjectValueL( KMPXMediaGeneralId, mpxId ); + mediaArray->AppendL( *newMedia ); + CleanupStack::PopAndDestroy( newMedia ); + } + CleanupStack::Pop( mediaArray ); + + iVideoList->SetTObjectValueL( KMPXMediaArrayCount, mediaArray->Count() ); + } + +// --------------------------------------------------------------------------- +// From class MMdEQueryObserver. +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsDb::HandleQueryNewResults( + CMdEQuery& /*aQuery*/, + TInt /*aFirstNewItemIndex*/, + TInt /*aNewItemCount*/ ) + { + } + +// --------------------------------------------------------------------------- +// Leaving version of HandleQueryNewResults. +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsDb::DoHandleQueryNewResultsL( + CMdEQuery& /*aQuery*/, + TInt /*aFirstNewItemIndex*/, + TInt /*aNewItemCount*/ ) + { + } + + + +// --------------------------------------------------------------------------- +// From class MMdEQueryObserver. +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsDb::HandleQueryCompleted( + CMdEQuery& /*aQuery*/, + TInt /*aError*/) + { + //iAsyncHandleQueryCompleteCaller->CallBack(); + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::AsyncHandleQueryCompleted +// --------------------------------------------------------------------------- +// +TInt CVcxMyVideosMdsDb::AsyncHandleQueryCompleted( TAny* /*aThis*/ ) + { + return KErrNone; + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::CreateVideoL +// --------------------------------------------------------------------------- +// +CMPXMedia* CVcxMyVideosMdsDb::CreateVideoL( TUint32 aId, TBool /*aFullDetails*/ ) + { + if( aId == KInvalidId ) + { + return NULL; + } + + if( aId == KMPXIdNotFound ) + { + return NULL; + } + + CMPXMedia* video = CMPXMedia::NewL( ); + CleanupStack::PushL( video ); + TMPXItemId id( aId, KVcxMvcMediaTypeVideo ); + video->SetTObjectValueL( KMPXMediaGeneralId, id ); + CleanupStack::Pop( video ); + return video; + } + +// --------------------------------------------------------------------------- +// From class MMdESessionObserver. +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsDb::HandleSessionOpened( + CMdESession& /*aSession*/, + TInt /*aError*/) + { + } + +// --------------------------------------------------------------------------- +// From class MMdESessionObserver. +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsDb::HandleSessionError( + CMdESession& /*aSession*/, + TInt aError) + { + iMdsDbObserver->HandleCreateVideoListResp( iVideoList, aError, ETrue ); + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::HandleObjectNotification +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsDb::HandleObjectNotification( + CMdESession& /*aSession*/, + TObserverNotificationType /*aType*/, + const RArray& /*aObjectIdArray*/) + { + //TRAP_IGNORE( DoHandleObjectNotificationL( aType, aObjectIdArray )); + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::ObjectL +// --------------------------------------------------------------------------- +// +CMdEObject* CVcxMyVideosMdsDb::ObjectL( const TItemId /*aId*/, TBool /*aIsVideo*/ ) + { + return NULL; + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::Object2MediaL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsDb::Object2MediaL( + CMdEObject& /*aObject*/, + CMPXMedia& /*aVideo*/, + TBool /*aFullDetails*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::Media2ObjectL +// Called by AddVideoL() +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsDb::Media2ObjectL( + CMPXMedia& /*aVideo*/, + CMdEObject& /*aObject*/) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::SetCreationDateToObjectL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsDb::SetCreationDateToObjectL( const CMPXMedia& /*aVideo*/, CMdEObject& /*aObject*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::GetSchemaDefinitionsL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsDb::GetSchemaDefinitionsL() + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::DoHandleObjectNotificationL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsDb::DoHandleObjectNotificationL( + TObserverNotificationType /*aType*/, + const RArray& /*aObjectIdArray*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::SetCreationAndModifiedDatesL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsDb::SetCreationAndModifiedDatesL( CMdEObject& /*aObject*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::MdsSessionL +// --------------------------------------------------------------------------- +// +CMdESession& CVcxMyVideosMdsDb::MdsSessionL() + { + return *iMdsSession; + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosMdsDb::ShutdownNotification +// From MVcxMdsShutDownMonitorObserver +// --------------------------------------------------------------------------- +// +void CVcxMyVideosMdsDb::ShutdownNotification( TInt /*aShutdownState*/ ) + { + } diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosmessagelist_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosmessagelist_stub.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,312 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Groups messages and sends them to clients.* +*/ + + + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "vcxmyvideoscollectionplugin.h" +#include "vcxmyvideoscollectionutil.h" +#include "vcxmyvideosmessagelist_stub.h" + +// ============================ MEMBER FUNCTIONS ============================== + +const TInt KMPXIdLeave = 999; + +// ---------------------------------------------------------------------------- +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CVcxMyVideosMessageList* CVcxMyVideosMessageList::NewL( + CVcxMyVideosCollectionPlugin& aCollection ) + { + CVcxMyVideosMessageList* self = new (ELeave) CVcxMyVideosMessageList( aCollection ); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// ---------------------------------------------------------------------------- +// Destructor. +// ---------------------------------------------------------------------------- +// +CVcxMyVideosMessageList::~CVcxMyVideosMessageList() + { + //delete iMessageList; + } + +// ---------------------------------------------------------------------------- +// Constructor. +// ---------------------------------------------------------------------------- +// +CVcxMyVideosMessageList::CVcxMyVideosMessageList( CVcxMyVideosCollectionPlugin& aCollection ) +: iCollection( aCollection ) + { + } + +// ---------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosMessageList::ConstructL () + { + } + +// ---------------------------------------------------------------------------------------------------------- +// CVcxMyVideosMessageList::AddEventL +// ---------------------------------------------------------------------------------------------------------- +// +void CVcxMyVideosMessageList::AddEventL( const TMPXItemId& aId, + TMPXChangeEventType aChange, TInt32 aExtraInfo, CMPXMedia* aVideo ) + { + //MPX_FUNC("CVcxMyVideosMessageList::AddEventL"); + + if( aId.iId1 == KMPXIdLeave ) + User::Leave( KErrCorrupt ); + + CreateMessageListL(); //does nothing if already created + +#if _DEBUG + //MPX_DEBUG1("CVcxMyVideosMessageList:: ----------------------------------------------." ); + + switch ( aChange ) + { + case EMPXItemDeleted: + //MPX_DEBUG4("CVcxMyVideosMessageList:: MPXID(%d,%d), aChange = EMPXItemDeleted, aExtraInfo = %d", + //aId.iId1, aId.iId2, aExtraInfo ); + break; + case EMPXItemInserted: + //MPX_DEBUG4("CVcxMyVideosMessageList:: MPXID(%d,%d), aChange = EMPXItemInserted, aExtraInfo = %d", + //aId.iId1, aId.iId2, aExtraInfo ); + break; + case EMPXItemModified: + //MPX_DEBUG4("CVcxMyVideosMessageList:: MPXID(%d,%d), aChange = EMPXItemModified, aExtraInfo = %d", + //aId.iId1, aId.iId2, aExtraInfo ); + break; + } + + //MPX_DEBUG1("CVcxMyVideosMessageList:: ----------------------------------------------'" ); +#endif + + if ( AlreadyInMessageListL( aId, aChange, aExtraInfo ) ) + { + //MPX_DEBUG1("CVcxMyVideosMessageList:: already in message list, skipping add"); + return; + } + + CMPXMessage* message = CMPXMedia::NewL(); + CleanupStack::PushL( message ); // 1-> + + message->SetTObjectValueL(KMPXMessageGeneralId, KMPXMessageIdItemChanged); + message->SetTObjectValueL(KMPXMessageCollectionId, TUid::Uid(KVcxUidMyVideosMpxCollection)); + message->SetTObjectValueL(KMPXMessageChangeEventType, aChange); + message->SetTObjectValueL(KMPXMessageMediaGeneralId, aId); + message->SetTObjectValueL( KMPXMessageMediaGeneralCategory, EMPXCollection ); + + if ( aVideo && aChange == EMPXItemInserted ) + { + message->SetCObjectValueL( KMPXCommandColAddMedia, aVideo ); + } + + if ( aExtraInfo ) + { + message->SetTObjectValueL( KVcxMediaMyVideosInt32Value, aExtraInfo ); + } + + //MPX_DEBUG1("CVcxMyVideosMessageList:: appending to message array"); + + iMessageArray->AppendL( message ); // ownership moves + + CleanupStack::Pop( message ); // <-1 + + iMessageCount++; + iMessageList->SetTObjectValueL( KMPXMessageArrayCount, iMessageCount ); + } + +// ---------------------------------------------------------------------------------------------------------- +// CVcxMyVideosMessageList::AddEventL +// ---------------------------------------------------------------------------------------------------------- +// +void CVcxMyVideosMessageList::AddEventL( TInt aEvent ) + { + TMPXItemId itemId; + itemId.iId1 = KVcxCommandIdMyVideos; + CMPXMedia* msg = CMPXMedia::NewL(); + CleanupStack::PushL( msg ); // 1-> + msg->SetTObjectValueL( KMPXMessageGeneralId, itemId ); + msg->SetTObjectValueL(KMPXMessageCollectionId, TUid::Uid(KVcxUidMyVideosMpxCollection)); + + msg->SetTObjectValueL( KVcxMediaMyVideosCommandId, aEvent ); + AddL( msg ); + CleanupStack::Pop( msg ); // <-1 + } + +// ---------------------------------------------------------------------------------------------------------- +// CVcxMyVideosMessageList::AlreadyInMessageListL +// ---------------------------------------------------------------------------------------------------------- +// +TBool CVcxMyVideosMessageList::AlreadyInMessageListL( const TMPXItemId& aId, + TMPXChangeEventType aChange, TInt32 aExtraInfo ) + { + TMPXItemId itemId; + TMPXChangeEventType event; + TInt32 extraInfo; + CMPXMedia* media; + TInt count = iMessageArray->Count(); + + for ( TInt i = 0; i < count; i++ ) + { + media = iMessageArray->AtL( i ); + + if ( media->IsSupported( KMPXMessageMediaGeneralId ) && + media->IsSupported( KMPXMessageChangeEventType ) ) + { + itemId = media->ValueTObjectL( KMPXMessageMediaGeneralId ); + event = media->ValueTObjectL( KMPXMessageChangeEventType ); + + if ( aId == itemId && aChange == event ) + { + extraInfo = 0; + if ( media->IsSupported( KVcxMediaMyVideosInt32Value ) ) + { + extraInfo = media->ValueTObjectL( KVcxMediaMyVideosInt32Value ); + } + if ( aExtraInfo == extraInfo ) + { + return ETrue; + } + else + { + return EFalse; + } + } + } + } + return EFalse; + } + +// ---------------------------------------------------------------------------------------------------------- +// CVcxMyVideosMessageList::AddL +// ---------------------------------------------------------------------------------------------------------- +// +void CVcxMyVideosMessageList::AddL( CMPXMessage* aMessage ) + { + if ( !aMessage ) + { + //MPX_DEBUG1("CVcxMyVideosMessageList::AddL aMessage is NULL!!"); + return; + } + +#ifdef _DEBUG + if ( aMessage->IsSupported( KVcxMediaMyVideosCommandId ) ) + { + switch ( aMessage->ValueTObjectL( KVcxMediaMyVideosCommandId ) ) + { + case KVcxMessageMyVideosItemsAppended: + //MPX_DEBUG1("CVcxMyVideosMessageList::AddL adding msg KVcxMessageMyVideosItemsAppended"); + break; + + case KVcxMessageMyVideosListComplete: + //MPX_DEBUG1("CVcxMyVideosMessageList::AddL adding msg KVcxMessageMyVideosListComplete"); + break; + + case KVcxMessageMyVideosMoveOrCopyStarted: + //MPX_DEBUG1("CVcxMyVideosMessageList::AddL adding msg KVcxMessageMyVideosMoveOrCopyStarted"); + break; + + case KVcxMessageMyVideosDeleteStarted: + //MPX_DEBUG1("CVcxMyVideosMessageList::AddL adding msg KVcxMessageMyVideosDeleteStarted"); + break; + + case KVcxMessageMyVideosMoveResp: + //MPX_DEBUG1("CVcxMyVideosMessageList::AddL adding msg KVcxMessageMyVideosMoveResp"); + break; + + case KVcxMessageMyVideosGetMediasByMpxIdResp: + //MPX_DEBUG1("CVcxMyVideosMessageList::AddL adding msg KVcxMessageMyVideosGetMediasByMpxIdResp"); + break; + + case KVcxMessageMyVideosCopyResp: + //MPX_DEBUG1("CVcxMyVideosMessageList::AddL adding msg KVcxMessageMyVideosCopyResp"); + break; + + case KVcxMessageMyVideosDeleteResp: + //MPX_DEBUG1("CVcxMyVideosMessageList::AddL adding msg KVcxMessageMyVideosDeleteResp"); + break; + default: + //MPX_DEBUG1("CVcxMyVideosMessageList::AddL unknown message"); + break; + } + } +#endif + + CreateMessageListL(); //does nothing if already created + iMessageArray->AppendL( aMessage ); // ownership moves + iMessageCount++; + iMessageList->SetTObjectValueL( KMPXMessageArrayCount, iMessageCount ); + } + +// ---------------------------------------------------------------------------------------------------------- +// CVcxMyVideosMessageList::SendL +// ---------------------------------------------------------------------------------------------------------- +// +void CVcxMyVideosMessageList::SendL() + { + //MPX_FUNC("CVcxMyVideosMessageList::SendL()"); + if ( iMessageCount == 0 || !iMessageList ) + { + //MPX_DEBUG1("CVcxMyVideosMessageList:: iMessageList is empty or NULL, skipping send"); + return; + } + + iCollection.SendMessages( *iMessageList ); + delete iMessageList; + iMessageList = NULL; + iMessageArray = NULL; + iMessageCount = 0; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosMessageList::CreateMessageListL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosMessageList::CreateMessageListL() + { + if ( !iMessageList ) + { + iMessageList = TVcxMyVideosCollectionUtil::CreateEmptyMessageListL(); + iMessageArray = iMessageList->Value( KMPXMessageArrayContents ); + + iMessageList->SetTObjectValueL(KMPXMessageGeneralId, KVcxCommandIdMyVideos); + iMessageList->SetTObjectValueL(KVcxMediaMyVideosCommandId, KVcxMessageMyVideosMessageArray ); + iMessageList->SetTObjectValueL(KMPXMessageCollectionId, TUid::Uid(KVcxUidMyVideosMpxCollection)); + //iMessageList->SetTObjectValueL(KMPXMessageChangeEventType, aChange); + //iMessageList->SetTObjectValueL(KMPXMessageMediaGeneralId, TMPXItemId(0, 0) ); + iMessageCount = 0; + } + } +// End of file + diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosopenhandler_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosopenhandler_stub.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,165 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Handles collection Open operation related functionality.* +*/ + + + +// INCLUDE FILES +#include +#include +#include +#include +#include +#include + +#include "vcxmyvideoscollectionplugin.h" +#include "vcxmyvideosopenhandler_stub.h" +#include "vcxmyvideosvideocache_stub.h" +#include "vcxmyvideosmdsdb.h" +#include "vcxmyvideoscategories.h" +#include "vcxmyvideosmessagelist.h" +#include "vcxmyvideoscollectionutil.h" +#include "vcxmyvideosalbums.h" +#include "vcxmyvideosmdsalbums.h" + +// ============================ MEMBER FUNCTIONS ============================= + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +CVcxMyVideosOpenHandler::CVcxMyVideosOpenHandler( CVcxMyVideosCollectionPlugin& aCollection, + CVcxMyVideosVideoCache& aCache, + CVcxMyVideosMdsDb& aMds ) +: iCollection( aCollection ), iCache( aCache ), iMds( aMds ) + { + } + +// --------------------------------------------------------------------------- +// 2nd-phase constructor +// --------------------------------------------------------------------------- +// +void CVcxMyVideosOpenHandler::ConstructL() + { + iCategoryIdsBeingOpened.Reset(); + iVideoListsBeingOpened.Reset(); + iAlbumIdsBeingOpened.Reset(); + iAlbumVideoListsBeingOpened.Reset(); + } + +// --------------------------------------------------------------------------- +// Two-Phase Constructor +// --------------------------------------------------------------------------- +// +CVcxMyVideosOpenHandler* CVcxMyVideosOpenHandler::NewL( CVcxMyVideosCollectionPlugin& aCollection, + CVcxMyVideosVideoCache& aCache, + CVcxMyVideosMdsDb& aMds ) + { + CVcxMyVideosOpenHandler* self = new(ELeave) CVcxMyVideosOpenHandler( aCollection, + aCache, aMds ); + CleanupStack::PushL( self ); + self->ConstructL(); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CVcxMyVideosOpenHandler::~CVcxMyVideosOpenHandler() + { + iCategoryIdsBeingOpened.Close(); + + TInt count = iVideoListsBeingOpened.Count(); + for ( TInt i = 0; i < count; i++ ) + { + delete iVideoListsBeingOpened[i]; + iVideoListsBeingOpened[i] = NULL; + } + iVideoListsBeingOpened.Close(); + + iAlbumIdsBeingOpened.Close(); + + count = iAlbumVideoListsBeingOpened.Count(); + for ( TInt i = 0; i < count; i++ ) + { + delete iAlbumVideoListsBeingOpened[i]; + iAlbumVideoListsBeingOpened[i] = NULL; + } + iAlbumVideoListsBeingOpened.Close(); + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosOpenHandler::OpenL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosOpenHandler::OpenL( + const CMPXCollectionPath& /*aPath*/ ) + { + } + +// --------------------------------------------------------------------------- +// CVcxMyVideosOpenHandler::OpenCategoryL +// --------------------------------------------------------------------------- +// +void CVcxMyVideosOpenHandler::OpenCategoryL( TUint32 /*aCategoryId*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosOpenHandler::DoHandleCreateVideoListRespL +// New items fetched from MDS. iCache.iVideoList = aVideoList. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosOpenHandler::DoHandleCreateVideoListRespL( + CMPXMedia* /*aVideoList*/, TInt aNewItemsStartIndex, TBool /*aComplete*/ ) + { + if ( aNewItemsStartIndex == KErrNotFound ) + User::Leave( KErrNotFound ); + + return; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosOpenHandler::HandleAlbumOpenL +// Album list has been fetched already. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosOpenHandler::HandleAlbumOpenL() + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosOpenHandler::HandleGetAlbumContentVideosResp +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosOpenHandler::HandleGetAlbumContentVideosResp( + TUint32 /*aAlbumId*/, CMPXMedia& /*aVideoList*/, TInt /*aError*/, + TInt /*aFirstNewItemIndex*/, TInt /*aNewItemCount*/, TBool /*aComplete*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosOpenHandler::HandleGetAlbumContentVideosRespL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosOpenHandler::HandleGetAlbumContentVideosRespL( + TUint32 /*aAlbumId*/, CMPXMedia& /*aVideoList*/, TInt /*aError*/, + TInt /*aFirstNewItemIndex*/, TInt /*aNewItemCount*/, TBool /*aComplete*/ ) + { + } + +// END OF FILE diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosvideocache_stub.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_collectionplugintest/src/vcxmyvideosvideocache_stub.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -0,0 +1,613 @@ +/* +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Video list cache. Contains cached data from MDS.* +*/ + + + + +// INCLUDE FILES +#include +#include +#include +#include "vcxmyvideosvideocache_stub.h" +#include "vcxmyvideoscollectionplugin.h" +#include "vcxmyvideoscollectionutil.h" +#include "vcxmyvideosopenhandler_stub.h" + +// constants used for testing +const TInt KMPXIdLeave = 999; +const TInt KMPXIdNotFound = 998; +const TInt KMPXIdChanged = 997; + + +// ============================ MEMBER FUNCTIONS ============================== + +// ---------------------------------------------------------------------------- +// constructor. +// ---------------------------------------------------------------------------- +// +TVcxMyVideosVideo::TVcxMyVideosVideo() +:iMdsId( 0 ), iVideo( NULL ), iPos( KErrNotFound ) + { + } + +// --------------------------------------------------------------------------- +// TVcxMyVideosVideo::operator= +// --------------------------------------------------------------------------- +// +TVcxMyVideosVideo& TVcxMyVideosVideo::operator=( const TVcxMyVideosVideo& aVideo ) + { + Set( aVideo.iMdsId, aVideo.iPos, aVideo.iVideo ); + return *this; + } + +// ---------------------------------------------------------------------------- +// TVcxMyVideosVideo::Set +// ---------------------------------------------------------------------------- +// +void TVcxMyVideosVideo::Set( TUint32 aMdsId, TInt aPos, CMPXMedia* aVideo ) + { + iMdsId = aMdsId; + iPos = aPos; + iVideo = aVideo; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoListIndex::NewL +// ---------------------------------------------------------------------------- +// +CVcxMyVideosVideoListIndex* CVcxMyVideosVideoListIndex::NewL() + { + CVcxMyVideosVideoListIndex* self = new (ELeave) CVcxMyVideosVideoListIndex(); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoListIndex::CVcxMyVideosVideoListIndex +// ---------------------------------------------------------------------------- +// +CVcxMyVideosVideoListIndex::CVcxMyVideosVideoListIndex() + { + + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoListIndex::ConstructL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosVideoListIndex::ConstructL () + { + iVideoArray.Reset(); + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoListIndex::~CVcxMyVideosVideoListIndex +// ---------------------------------------------------------------------------- +// +CVcxMyVideosVideoListIndex::~CVcxMyVideosVideoListIndex() + { + iVideoArray.Close(); + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoListIndex::~CVcxMyVideosVideoListIndex +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosVideoListIndex::SetL( const CMPXMedia& /*aVideoList*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoListIndex::Find +// ---------------------------------------------------------------------------- +// +TInt CVcxMyVideosVideoListIndex::Find( TUint32 aMdsId, TVcxMyVideosVideo& aVideo ) + { + return KErrNone; + + const TLinearOrder KOrderByMdsId( + CVcxMyVideosVideoListIndex::CompareVideosByMdsId ); + + TInt index; + TVcxMyVideosVideo video; + video.iMdsId = aMdsId; + TInt err = iVideoArray.FindInOrder( video, index, KOrderByMdsId ); + + if ( err != KErrNone ) + { + return KErrNotFound; + } + + aVideo = iVideoArray[index]; + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoListIndex::Remove +// ---------------------------------------------------------------------------- +// +TInt CVcxMyVideosVideoListIndex::Remove( TUint32 aMdsId, TBool aCompress ) + { + const TLinearOrder KOrderByMdsId( + CVcxMyVideosVideoListIndex::CompareVideosByMdsId ); + + TVcxMyVideosVideo video; + video.iMdsId = aMdsId; + TInt pos; + TInt posInVideoList; + TInt err = iVideoArray.FindInOrder( video, pos, KOrderByMdsId ); + if ( err == KErrNone ) + { + posInVideoList = iVideoArray[pos].iPos; + iVideoArray.Remove( pos ); + + // update all indexes which are bigger than posInVideoList + TInt count = iVideoArray.Count(); + for ( TInt i = 0; i < count; i++ ) + { + if ( iVideoArray[i].iPos > posInVideoList ) + { + iVideoArray[i].iPos--; + } + } + } + + if ( aCompress ) + { + iVideoArray.Compress(); + } + + return err; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoListIndex::AddL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosVideoListIndex::AddL( CMPXMedia* aVideo, TInt aPos ) + { + TVcxMyVideosVideo video; + video.Set( TVcxMyVideosCollectionUtil::IdL( *aVideo ).iId1, aPos, aVideo ); + + const TLinearOrder KOrderByMdsId( + CVcxMyVideosVideoListIndex::CompareVideosByMdsId ); + + // update indexes + TInt count = iVideoArray.Count(); + for ( TInt i = 0; i < count; i++ ) + { + if ( iVideoArray[i].iPos >= aPos ) + { + iVideoArray[i].iPos++; + } + } + + iVideoArray.InsertInOrderAllowRepeatsL( video, KOrderByMdsId ); + + } + +#ifdef _DEBUG +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoListIndex::VideoArray +// ---------------------------------------------------------------------------- +// +const RArray& CVcxMyVideosVideoListIndex::VideoArray() + { + return iVideoArray; + } +#endif + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoListIndex::Sort +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosVideoListIndex::Sort() + { + const TLinearOrder KOrderByMdsId( + CVcxMyVideosVideoListIndex::CompareVideosByMdsId ); + + iVideoArray.Sort( KOrderByMdsId ); + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoListIndex::CompareVideosByMdsId +// ---------------------------------------------------------------------------- +// +TInt CVcxMyVideosVideoListIndex::CompareVideosByMdsId( const TVcxMyVideosVideo& aVideo1, + const TVcxMyVideosVideo& aVideo2 ) + { + if ( aVideo1.iMdsId == aVideo2.iMdsId ) + { + return 0; + } + + if ( aVideo1.iMdsId < aVideo2.iMdsId ) + { + return -1; + } + return 1; + } + +// ---------------------------------------------------------------------------- +// Two-phased constructor. +// ---------------------------------------------------------------------------- +// +CVcxMyVideosVideoCache* CVcxMyVideosVideoCache::NewL( + CVcxMyVideosCollectionPlugin& aMyVideosCollectionPlugin ) + { + CVcxMyVideosVideoCache* self = new (ELeave) CVcxMyVideosVideoCache( aMyVideosCollectionPlugin ); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; + } + +// ---------------------------------------------------------------------------- +// Destructor. +// ---------------------------------------------------------------------------- +// +CVcxMyVideosVideoCache::~CVcxMyVideosVideoCache() + { + delete iVideoList; + DeletePartialList(); + delete iVideoListIndex; + } + +// ---------------------------------------------------------------------------- +// Constructor. +// ---------------------------------------------------------------------------- +// +CVcxMyVideosVideoCache::CVcxMyVideosVideoCache( + CVcxMyVideosCollectionPlugin& aMyVideosCollectionPlugin ) +: iCollection( aMyVideosCollectionPlugin ) + { + } + +// ---------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosVideoCache::ConstructL () + { + iVideoList = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL(); + SetComplete( EFalse ); + + iPartialVideoList.Reset(); + iVideoListIndex = CVcxMyVideosVideoListIndex::NewL(); + + iCancelListFetching = EFalse; // TESTING STUFF + iLeaveOnReset = EFalse; // TESTING STUFF + } + +// ---------------------------------------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::CreateVideoListByOriginL +// ---------------------------------------------------------------------------------------------------------- +// +CMPXMedia* CVcxMyVideosVideoCache::CreateVideoListByOriginL( TUint8 /*aOrigin*/ ) + { + return NULL; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::AppendToListL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosVideoCache::AppendToListL( CMPXMedia& /*aToList*/, CMPXMedia& /*aFromList*/, + TUint8 /*aOrigin*/, TInt /*aNewItemsStartIndex*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::FindVideoByUriL +// ---------------------------------------------------------------------------- +// +CMPXMedia* CVcxMyVideosVideoCache::FindVideoByUriL( const TDesC& /*aUri*/ ) + { + return NULL; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::FindVideoByMdsIdL +// ---------------------------------------------------------------------------- +// +CMPXMedia* CVcxMyVideosVideoCache::FindVideoByMdsIdL( TUint32 aMdsId, TInt& /*aPos*/ ) + { + if( aMdsId == KMPXIdNotFound ) + { + return NULL; + } + + CMPXMediaArray* videoarray = iVideoList->Value( KMPXMediaArrayContents ); + if( videoarray->Count() > 0 ) + { + return videoarray->AtL(0); + } + + return NULL; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::GetVideosL +// ---------------------------------------------------------------------------- +// +CMPXMedia* CVcxMyVideosVideoCache::GetVideosL( RArray& aMdsIds ) + { + CMPXMessage* videoList = TVcxMyVideosCollectionUtil::CreateEmptyMediaListL(); + CleanupStack::PushL( videoList ); // 1-> + + // copy from iVideoList + TVcxMyVideosCollectionUtil::CopyFromListToListL( + *iVideoList, *videoList, aMdsIds ); + + // copy from iPartialVideoList + TVcxMyVideosCollectionUtil::CopyFromListToListL( + iPartialVideoList, *videoList, aMdsIds ); + + CleanupStack::Pop( videoList ); // <-1 + return videoList; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::AddVideosFromMdsL +// Called when item inserted events arrive from mds or from +// KVcxCommandMyVideosGetMediasByMpxId cmd handler. +// If mpx item is already in cache, or MDS does not contain the item (or was not video item), +// then it is removed from aMdsIds. Ie after this function call aMdsIds contains +// only IDs which are actually added to cache. aNonVideoIds will contain IDs +// which were not video objects. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosVideoCache::AddVideosFromMdsL( RArray& /*aMdsIds*/, + TBool& aListFetchingWasCanceled, RArray* /*aNonVideoIds*/, TBool /*aUpdateCategories*/ ) + { + aListFetchingWasCanceled = iCancelListFetching; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::AddL() +// This is for single adds, video list fetching does not call this. +// ---------------------------------------------------------------------------- +// +TInt CVcxMyVideosVideoCache::AddL( CMPXMedia* /*aVideo*/, TVcxMyVideosSortingOrder /*aSortingOrder*/, + TBool /*aUpdateCategories*/ ) + { + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::CheckForPartialVideoListItemsL() +// This is called by iCollection during video list fetching. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosVideoCache::CheckForPartialVideoListItemsL( TInt /*aNewItemsStartIndex*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::PosOnPartialVideoListL() +// ---------------------------------------------------------------------------- +// +TInt CVcxMyVideosVideoCache::PosOnPartialVideoListL( CMPXMedia& /*aVideo*/ ) + { + return KErrNotFound; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::PosOnVideoListL() +// ---------------------------------------------------------------------------- +// +TInt CVcxMyVideosVideoCache::PosOnVideoListL( CMPXMedia& /*aVideo*/ ) + { + return KErrNotFound; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::AddToPartialListL() +// ---------------------------------------------------------------------------- +// +TInt CVcxMyVideosVideoCache::AddToPartialListL( CMPXMedia* /*aVideo*/ ) + { + return KErrNotFound; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::DeletePartialList() +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosVideoCache::DeletePartialList() + { + TInt count( iPartialVideoList.Count() ); + for ( TInt i = count -1; i >= 0; i-- ) + { + delete iPartialVideoList[i]; + iPartialVideoList[i] = NULL; + } + iPartialVideoList.Close(); + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::CreateVideoListL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosVideoCache::CreateVideoListL( TBool /*aForce*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::UpdateVideoL +// ---------------------------------------------------------------------------- +// +TBool CVcxMyVideosVideoCache::UpdateVideoL( CMPXMedia& aVideo ) + { + TBool changed( EFalse ); + + TMPXItemId mpxId = aVideo.ValueTObjectL( KMPXMediaGeneralId ); + + switch( mpxId.iId1 ) + { + case KMPXIdLeave: // Leave + User::Leave( KErrCorrupt ); + break; + case KMPXIdNotFound: // Not found + User::Leave( KErrNotFound ); + break; + case KMPXIdChanged: // Changed + changed = ETrue; + } + + return changed; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::HandleVideoTitleModifiedL +// Updates sorting order and category attributes if necessarry +// NOTICE that aVideoInCache is not allowed to own the media object, since this +// function may change the pointer value to point to a new object. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosVideoCache::HandleVideoTitleModifiedL( CMPXMedia*& /*aVideoInCache*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::FindCorrectPositionL +// Finds the correct position using bisection method. +// ---------------------------------------------------------------------------- +// +TInt CVcxMyVideosVideoCache::FindCorrectPositionL( CMPXMedia& /*aMedia*/, + TVcxMyVideosSortingOrder /*aSortingOrder*/ ) + { + return 0; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::CompareL +// ---------------------------------------------------------------------------- +// +TInt CVcxMyVideosVideoCache::CompareL( CMPXMedia& /*aNewVideo*/, CMPXMedia& /*aVideoInList*/, + TVcxMyVideosSortingOrder /*aSortingOrder*/ ) + { + return 0; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::SortingOrderL +// ---------------------------------------------------------------------------- +// +TVcxMyVideosSortingOrder CVcxMyVideosVideoCache::SortingOrderL() + { + return EVcxMyVideosSortingNone; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::AddToCorrectPlaceL +// ---------------------------------------------------------------------------- +// +TInt CVcxMyVideosVideoCache::AddToCorrectPlaceL( CMPXMedia& aVideo, + TVcxMyVideosSortingOrder aSortingOrder, TBool aUpdateCategories ) + { + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::MoveToCorrectPlaceL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosVideoCache::MoveToCorrectPlaceL( CMPXMedia& /*aVideo*/, + TVcxMyVideosSortingOrder /*aSortingOrder*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::RemoveL +// ---------------------------------------------------------------------------- +// +TInt CVcxMyVideosVideoCache::RemoveL( CMPXMedia& aVideo, TBool aUpdateCategories ) + { + return RemoveL( TVcxMyVideosCollectionUtil::IdL( aVideo ).iId1, aUpdateCategories ); + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::RemoveL +// All removes end up here (except ResetVideoListL). +// ---------------------------------------------------------------------------- +// +TInt CVcxMyVideosVideoCache::RemoveL( TUint32 aMdsId, TBool aUpdateCategories ) + { + return KErrNone; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::RemoveL +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosVideoCache::RemoveL( RArray& /*aMdsIds*/, TBool /*aUpdateCategories*/ ) + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::ResetVideoListL +// iVideoList stays the same, media array is deleted and recreated to 0 length, +// media items are deleted. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosVideoCache::ResetVideoListL() + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::ReCreateVideoListL +// iVideoList and its media array are deleted and recreated. New instances point to +// different global heap position. Media objects stay the same and point to +// same global heap. +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosVideoCache::ReCreateVideoListL() + { + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::IsComplete +// ---------------------------------------------------------------------------- +// +TBool CVcxMyVideosVideoCache::IsComplete() + { + return iVideoListIsComplete; + } + +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::SetComplete +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosVideoCache::SetComplete( TBool aComplete ) + { + iVideoListIsComplete = aComplete; + } + +#ifdef _DEBUG +// ---------------------------------------------------------------------------- +// CVcxMyVideosVideoCache::SetComplete +// ---------------------------------------------------------------------------- +// +void CVcxMyVideosVideoCache::CheckVideoListIndexL() + { + } +#endif + +// End of file + diff -r 3eb824b18d67 -r 375929f879c2 videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/group/bld.inf --- a/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/group/bld.inf Wed Sep 15 12:15:24 2010 +0300 +++ b/videocollection/mpxmyvideoscollection/tsrc/ut_vcxmyvideosmdsdb/group/bld.inf Wed Oct 13 14:34:36 2010 +0300 @@ -15,19 +15,21 @@ * */ -// Version : %version: 1 % +// Version : %version: 2 % PRJ_PLATFORMS DEFAULT -PRJ_EXPORTS +PRJ_TESTEXPORTS ../conf/VcxMyVideosMdsDbTest.cfg /epoc32/winscw/c/testframework/VcxMyVideosMdsDbTest.cfg ../init/testframework.ini /epoc32/winscw/c/testframework/testframework.ini PRJ_EXPORTS +PRJ_TESTMMPFILES +VcxMyVideosMdsDbTest.mmp PRJ_MMPFILES -VcxMyVideosMdsDbTest.mmp + diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/inc/mpxvideobaseplaybackview.h --- a/videoplayback/inc/mpxvideobaseplaybackview.h Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayback/inc/mpxvideobaseplaybackview.h Wed Oct 13 14:34:36 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 26 % +// Version : %version: 25 % // This file defines the API for VideoBasePlaybackView.dll @@ -387,10 +387,9 @@ TBool iPdlReloading; TBool iRealOneDelayedPlay; TBool iKeyboardInFocus; - TBool iExitPlayer; HBufC* iClipName; - + TBool iSyncClose; }; diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/inc/mpxvideoplaybackcontrolscontroller.h --- a/videoplayback/inc/mpxvideoplaybackcontrolscontroller.h Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayback/inc/mpxvideoplaybackcontrolscontroller.h Wed Oct 13 14:34:36 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 20 % +// Version : %version: 19 % #ifndef MPXVIDEOPLAYBACKCONTROLSCONTROLLER_H_ @@ -228,11 +228,6 @@ TBool IsVisible(); /** - * Return ETrue if real one bitmap is visible - */ - TBool IsRealOneBitmapVisible(); - - /** * Append a control based on control index */ void AppendControlL( TMPXVideoPlaybackControls aControlIndex ); diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/inc/mpxvideoplaybackmediadetailsviewer.h --- a/videoplayback/inc/mpxvideoplaybackmediadetailsviewer.h Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayback/inc/mpxvideoplaybackmediadetailsviewer.h Wed Oct 13 14:34:36 2010 +0300 @@ -15,9 +15,7 @@ * */ - -// Version : %version: 7 % - +// Version : %version: e003sa33#6 % #ifndef MPXVIDEOPLAYBACKMEDIADETAILSVIEWER_H_ #define MPXVIDEOPLAYBACKMEDIADETAILSVIEWER_H_ @@ -80,12 +78,12 @@ * @param aRect drawable area. */ void Draw( const TRect& aRect ) const; - + /** * Creates new skins for the control * @return void */ - void SkinChangeL(); + void SkinChangeL(); public: // from CoeControl @@ -102,56 +100,56 @@ * @since 5.0 */ void Reset(); - - /** + + /** * Accessor for the dynamically calculated viewer rect - * @since 9.2 + * @since 9.2 * @return the viewer rect - */ - TRect ViewerRect(); - + */ + TRect ViewerRect(); + private: - + void CreateLabelsL(); - + void LaunchDRMDetailsL(); - + /** * Sets label rects and text */ - void FormatLabelsL() const; - + void FormatLabelsL() const; + void UpdateBackgroundBitmapL() const; - - /** + + /** * Timer callback for scroll timer - * @since 9.2 - * @param aPtr Pointer to timers callback - * @return KErrNone - */ + * @since 9.2 + * @param aPtr Pointer to timers callback + * @return KErrNone + */ static TInt ScrollTimer( TAny* aPtr ); - /** + /** * Handle Scroll Timer - * @since 9.2 - * @return void - */ + * @since 9.2 + * @return void + */ void HandleScrollTimerL(); - - /** + + /** * Determine the number of items to be shown in the viewer - * @since 9.2 + * @since 9.2 * @return the number of rows to be created - */ + */ TInt NumOfItemsShownInViewerL(); - - /** + + /** * Dynamically calculate determine the viewer rectangle dyanmically - * @since 9.2 + * @since 9.2 * @return the viewer rect - */ - TRect CalculateViewerRectL(); + */ + TRect CalculateViewerRectL(); /** * Update the text of filename label @@ -164,14 +162,14 @@ void UpdateTitleL(); private: - + /** * Scroll the too long text for some label */ class TTextScroller { public: - + /** * Constructor */ @@ -196,38 +194,37 @@ void ScrollText( const TDesC& aSrcText, TDes& aDesText ); private: - - TUint32 iDelayBeginningTick; - TInt iTextScrollPos; - TBool iDelay; - TBool iScroll; - TInt iSrcTextLen; + + TUint32 iDelayBeginningTick; + TInt iTextScrollPos; + TBool iDelay; + TBool iScroll; + TInt iSrcTextLen; }; private: // Data - + CMPXVideoPlaybackControlsController* iController; - + CEikLabel* iClipnameLabel; CEikLabel* iTitleLabel; - CEikLabel* iArtistLabel; + CEikLabel* iArtistLabel; CEikLabel* iFormatLabel; CEikLabel* iResolutionLabel; CEikLabel* iDurationLabel; CEikLabel* iBitrateLabel; CEikLabel* iLicenseLabel; CEikLabel* iAdditionalLabel; - + - CFbsBitmap* iBackgroundBitmap; + CFbsBitmap* iBackgroundBitmap; CPeriodic* iScrollingTextTimer; TRect iViewerRect; HBufC* iAdditionalString; TTextScroller iFilenameScroller; TTextScroller iTitleScroller; // after every scrolling label has updated, draw them - TBool iScrolledTextUpdated; - TBool iDrmDetailsLaunched; + TBool iScrolledTextUpdated; }; diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/videohelix/group/mpxvideohelixplayback.mmp --- a/videoplayback/videohelix/group/mpxvideohelixplayback.mmp Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayback/videohelix/group/mpxvideohelixplayback.mmp Wed Oct 13 14:34:36 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 16.1.1 % +// Version : %version: 16 % @@ -44,7 +44,6 @@ SOURCE mpxvideoplayerutility.cpp SOURCE mpxvideodrmhelper.cpp SOURCE mpxvideoposterframesetter.cpp -SOURCE mpxcalldetector.cpp START RESOURCE ../data/10282550.rss TARGET mpxvideohelixplayback.rsc diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/videohelix/inc/mpxcalldetector.h --- a/videoplayback/videohelix/inc/mpxcalldetector.h Wed Sep 15 12:15:24 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ -/* -* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Class for call detaction -* -*/ - -// Version : %version: 1 % - -#ifndef MPXCALLDETECTOR_H -#define MPXCALLDETECTOR_H - -#include -#include - -class MMPXCallDetectorObserver -{ - public: - virtual void CallDetectedL() = 0; -}; - -/** - * Detector for incoming call - */ -NONSHARABLE_CLASS( CMPXCallDetector ) : public CActive -{ - public: // Constructors and destructor - - /** - * Two-phased constructor. - */ - static CMPXCallDetector* NewL( MMPXCallDetectorObserver* aObserver ); - - /** - * Destructor. - */ - ~CMPXCallDetector(); - - public: // New functions - - /** - * Request call notifications - * - */ - void RequestNotification(); - - private: - - /** - * C++ default constructor. - */ - CMPXCallDetector( MMPXCallDetectorObserver* aObserver ); - - /** - * Symbian OS 2nd phase constructor. - */ - void ConstructL(); - - /** - * From CActive - * @see CActive for more information - */ - void RunL(); - - /** - * From CActive - * @see CActive for more information - */ - void DoCancel(); - - private: - - // Call observer - MMPXCallDetectorObserver* iObserver; - RProperty iTsyProperty; -}; - -#endif // CALLDETECTOR_H diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/videohelix/inc/mpxvideoplaybackcontroller.h --- a/videoplayback/videohelix/inc/mpxvideoplaybackcontroller.h Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayback/videohelix/inc/mpxvideoplaybackcontroller.h Wed Oct 13 14:34:36 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 30 % +// Version : %version: 29 % #ifndef _CMPXVIDEOPLAYBACKCONTROLLER_H_ @@ -41,7 +41,6 @@ #include "mpxvideoplayerutility.h" #include "mpxvideo_debug.h" -#include "mpxcalldetector.h" // DATA TYPES // FORWARD DECLARATIONS @@ -69,7 +68,6 @@ NONSHARABLE_CLASS( CMPXVideoPlaybackController ) : public CBase , public MMPXCenRepObserver - , public MMPXCallDetectorObserver { public: // @@ -148,7 +146,6 @@ private: - void CallDetectedL(); void SetDisplayWindowL( CMPXCommand& aCmd ); void RestartDSA( CMPXCommand& aCmd ); @@ -264,9 +261,6 @@ // Timer monitoring user activity when TV-out is connected CPeriodic* iUserActivityTimer; - // Call detector - CMPXCallDetector* iCallDetector; - TBool iSeekable; CMpxVideoDrmHelper* iDrmHelper; diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/videohelix/inc/mpxvideoplaybackstate.h --- a/videoplayback/videohelix/inc/mpxvideoplaybackstate.h Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayback/videohelix/inc/mpxvideoplaybackstate.h Wed Oct 13 14:34:36 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 21 % +// Version : %version: 20 % #ifndef _CMPXVIDEOPLAYBACKSTATE_H_ @@ -225,7 +225,6 @@ virtual void HandleStop(); virtual void HandleForeground(); virtual void HandleBackground(); - virtual void HandlePause(); // general method virtual void HandleSetPositionL(TInt aPosition); diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/videohelix/src/mpxcalldetector.cpp --- a/videoplayback/videohelix/src/mpxcalldetector.cpp Wed Sep 15 12:15:24 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,124 +0,0 @@ -/* -* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - -// Version : %version: 1 % - -// INCLUDE FILES -#include - -#include "mpxcalldetector.h" -#include "mpxvideo_debug.h" - - -// --------------------------------------------------------------------------- -// CCallDetector::NewL -// -// --------------------------------------------------------------------------- -// -CMPXCallDetector* CMPXCallDetector::NewL( MMPXCallDetectorObserver* aObserver ) -{ - MPX_ENTER_EXIT(_L("CMPXCallDetector::NewL()")); - - CMPXCallDetector* self = new( ELeave ) CMPXCallDetector( aObserver ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; -} - -// --------------------------------------------------------------------------- -// Destructor -// -// --------------------------------------------------------------------------- -// -CMPXCallDetector::~CMPXCallDetector() -{ - Cancel(); - iTsyProperty.Close(); -} - -// --------------------------------------------------------------------------- -// CCallDetector::RequestNotification -// -// --------------------------------------------------------------------------- -// -void CMPXCallDetector::RequestNotification() -{ - MPX_ENTER_EXIT(_L("CCallDetector::RequestNotification()")); - - iTsyProperty.Subscribe( iStatus ); - SetActive(); -} - -// --------------------------------------------------------------------------- -// Constructor -// -// --------------------------------------------------------------------------- -// -CMPXCallDetector::CMPXCallDetector( MMPXCallDetectorObserver* aObserver ) - : CActive( EPriorityStandard ), iObserver( aObserver ) -{ -} - -// --------------------------------------------------------------------------- -// CCallDetector::ConstructL -// -// --------------------------------------------------------------------------- -// -void CMPXCallDetector::ConstructL() -{ - MPX_ENTER_EXIT(_L("CCallDetector::ConstructL")); - - User::LeaveIfError( iTsyProperty.Attach( KPSUidCtsyCallInformation, KCTsyCallState ) ); - - CActiveScheduler::Add( this ); -} - -// --------------------------------------------------------------------------- -// CCallDetector::RunL -// Called when the voice line status changes. -// --------------------------------------------------------------------------- -// -void CMPXCallDetector::RunL() -{ - TInt status = iStatus.Int(); - - RequestNotification(); - - if ( status == KErrNone ) - { - TInt status; - iTsyProperty.Get( status ); - - if ( status != EPSCTsyCallStateNone ) - { - iObserver->CallDetectedL(); - } - } -} - -// --------------------------------------------------------------------------- -// CCallDetector::DoCancel -// -// --------------------------------------------------------------------------- -// -void CMPXCallDetector::DoCancel() -{ - iTsyProperty.Cancel(); -} - -// End of File diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp --- a/videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayback/videohelix/src/mpxvideoplaybackcontroller.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 66 % +// Version : %version: 64 % // @@ -167,9 +167,6 @@ iDrmHelper = CMpxVideoDrmHelper::NewL(); - iCallDetector = CMPXCallDetector::NewL( this ); - iCallDetector->RequestNotification(); - iSavedPosition = 0; iViewActivated = EFalse; } @@ -294,14 +291,6 @@ delete iSeekingState; delete iStoppedState; - if ( iCallDetector ) - { - iCallDetector->Cancel(); - - delete iCallDetector; - iCallDetector = NULL; - } - if ( iPlaybackMode ) { delete iPlaybackMode; @@ -930,7 +919,7 @@ // ------------------------------------------------------------------------------------------------ void CMPXVideoPlaybackController::SetMuteCenRepL( TBool aMute ) { - if ( iFileDetails && iFileDetails->iAudioEnabled ) + if ( iFileDetails && iFileDetails->iAudioEnabled && !iAccessoryMonitor->IsTvOutConnected() ) { iMuteWatcher->SetValueL( aMute ); @@ -2562,13 +2551,4 @@ iPlaybackMode->HandleFrameReady(aError); } - -void CMPXVideoPlaybackController::CallDetectedL() -{ - MPX_ENTER_EXIT(_L("CMPXVideoPlaybackController::CallDetectedL")); - - // Pause playback - DoHandleCommandL( EPbCmdPause ); -} - // End of file diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/videohelix/src/mpxvideoplaybackstate.cpp --- a/videoplayback/videohelix/src/mpxvideoplaybackstate.cpp Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayback/videohelix/src/mpxvideoplaybackstate.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 48 % +// Version : %version: 46.1.1 % // @@ -243,6 +243,7 @@ if ( aError == KErrNone ) { + iVideoPlaybackCtlr->iMPXPluginObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPPlayComplete, 0, @@ -1275,16 +1276,6 @@ CommandHandleForeground(); } -// ------------------------------------------------------------------------------------------------ -// CMPXInitialisedState::HandlePause() -// ------------------------------------------------------------------------------------------------ -void CMPXInitialisedState::HandlePause() -{ - MPX_ENTER_EXIT(_L("CMPXInitialisedState::HandlePause()")); - - iVideoPlaybackCtlr->iPlaybackMode->HandlePause(); -} - // ************************************************************************************************* // // CMPXPlayingState diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/videohelix/tsrc/ut_videohelixtest/conf/videohelixtest.cfg --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/conf/videohelixtest.cfg Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/conf/videohelixtest.cfg Wed Oct 13 14:34:36 2010 +0300 @@ -589,7 +589,7 @@ waittestclass test test PlayduringVoiceCall pause 100 -test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackPlaying +test IssueGeneralCommand EPbCmdPlay KErrNone ECallbackBuffering pause 1000 test EndPhoneCall delete test diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/videohelix/tsrc/ut_videohelixtest/group/videohelixtest.mmp --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/group/videohelixtest.mmp Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/group/videohelixtest.mmp Wed Oct 13 14:34:36 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 10.1.1 % +// Version : %version: 10 % @@ -62,7 +62,6 @@ SOURCE mpxvideoplaybackstate.cpp SOURCE mpxvideoseeker.cpp SOURCE mpxvideoposterframesetter.cpp -SOURCE mpxcalldetector.cpp LIBRARY euser.lib diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/videohelix/tsrc/ut_videohelixtest/inc/videohelixtest.h --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/videohelixtest.h Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/inc/videohelixtest.h Wed Oct 13 14:34:36 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 16 % +// Version : %version: e003sa33#15 % #ifndef __VHPPTESTCASE_H__ @@ -35,10 +35,10 @@ #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include "timeoutController.h" diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp --- a/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayback/videohelix/tsrc/ut_videohelixtest/src/videohelixtestbody.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 27 % +// Version : %version: e003sa33#24.1.1 % // [INCLUDE FILES] - do not remove @@ -120,8 +120,9 @@ ENTRY ("InitializeWithPositionL", CVHPPTestClass::InitializeWithPositionL), ENTRY ("InitializeLinkWithPositionL", CVHPPTestClass::InitializeLinkWithPositionL), ENTRY ("InitializeHandleWithPositionL", CVHPPTestClass::InitializeHandleWithPositionL), - ENTRY ( "InitializeStreamingWithSdpFileHandleL", CVHPPTestClass::InitializeStreamingWithSdpFileHandleL ), - ENTRY ( "RetrieveFileNameAndModeL", CVHPPTestClass::RetrieveFileNameAndModeL ) + ENTRY ( "InitializeStreamingWithSdpFileHandleL", + CVHPPTestClass::InitializeStreamingWithSdpFileHandleL ), + ENTRY ( "RetrieveFileNameAndModeL", CVHPPTestClass::RetrieveFileNameAndModeL ) // // ADD NEW ENTRIES HERE @@ -289,7 +290,7 @@ TInt duration; TInt volumeSteps; - + TInt err = aItem.GetNextInt( duration ); if ( err == KErrNone ) @@ -305,32 +306,32 @@ AddExpectedEvent( event ); - // + // // read number of volume steps // err = aItem.GetNextInt( volumeSteps ); - + if ( err == KErrNone ) - { + { // // set volume steps // SetVolumeSteps( volumeSteps ); - - TBuf<120> fullPath; + + TBuf<120> fullPath; err = ReadFileInitializationParameters( aItem, fullPath ); - + if ( err == KErrNone ) { PreparePluginL(); - + // // Initalize the Plugin with a file name // MPX_DEBUG(_L("Initialize the Plugin: filename = %S"), &fullPath); iLog->Log(_L("Initialize the Plugin: filename = %S"), &fullPath); - + iPlaybackPlugin->InitialiseL( fullPath ); } } @@ -367,40 +368,40 @@ AddExpectedEvent( event ); - // + // // read number of volume steps // err = aItem.GetNextInt( volumeSteps ); - + if ( err == KErrNone ) - { + { // // set volume steps // SetVolumeSteps( volumeSteps ); - + TPtrC link; - + // // Read in the link from the config file // TInt err = aItem.GetNextString( link ); - + if ( err == KErrNone ) { TInt err = ReadInitializationErrors( aItem ); - + if ( err == KErrNone ) { PreparePluginL(); - + // // Extract the streaming link from the ram file and // Initalize the Plugin with the link and an access point // MPX_DEBUG(_L("Initialize the Plugin: link = %S"), &link); iLog->Log(_L("Initialize the Plugin: link = %S"), &link); - + iPlaybackPlugin->InitStreamingL( link, KNullDesC8, 11 ); } } @@ -462,57 +463,57 @@ TInt duration; TInt volumeSteps; TInt fileHandle32; - + TInt err = aItem.GetNextInt( fileHandle32 ); - + if ( err == KErrNone ) - { - + { + #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API // // set RFile as default if the 64-bit flag is not defined // fileHandle32 = ETrue; #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - + err = aItem.GetNextInt( duration ); - + if ( err == KErrNone ) { // // We will always get an Init Complete message out // TCallbackEvent* event = new TCallbackEvent; - + event->iEvent = EPInitialised; event->iData = duration; event->iError = KErrNone; - + AddExpectedEvent( event ); - - // + + // // read number of volume steps // err = aItem.GetNextInt( volumeSteps ); - + if ( err == KErrNone ) - { + { // // set volume steps // SetVolumeSteps( volumeSteps ); - + TBuf<120> fullPath; - + err = ReadFileInitializationParameters( aItem, fullPath ); - + if ( err == KErrNone ) { PreparePluginL(); - + RFs fs; TInt error = fs.Connect(); - + // // Open a file handle to the clip // @@ -532,18 +533,18 @@ file64.Close(); } #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - + // // Initalize the Plugin with a file name // MPX_DEBUG(_L("Initialize the Plugin with File Handle: filename = %S"), &fullPath); iLog->Log(_L("Initialize the Plugin with File Handle: filename = %S"), &fullPath); - + fs.Close(); } - } - } - } + } + } + } return err; } @@ -890,14 +891,14 @@ event->iError = KErrNone; AddExpectedEvent( event ); } - else - { - event->iEvent = EPSetComplete; - event->iData = property; - event->iError = KErrNone; - AddExpectedEvent( event ); - } - + else + { + event->iEvent = EPSetComplete; + event->iData = property; + event->iError = KErrNone; + AddExpectedEvent( event ); + } + } TRAP( err, iPlaybackPlugin->SetL( (TMPXPlaybackProperty)property, value ) ); @@ -1146,9 +1147,9 @@ iLog->Log(_L("CVHPPTestClass::ConnectToDownloadL()")); TInt err = KErrNone; - -#ifdef USE_S60_DOWNLOAD_MANAGER - + +#ifdef USE_S60_DOWNLOAD_MANAGER + iDlMgrTester = CDlMgrTestClass::NewL(); iDlMgrTester->AddStifObserver( this ); @@ -1195,17 +1196,17 @@ CleanupStack::PopAndDestroy( cmd ); } } - -#else // USE_S60_DOWNLOAD_MANAGER - - // suppress build warning - MPX_DEBUG(_L("CVHPPTestClass::ConnectToDownloadL() : parsing type = %d"), aItem.ParsingType()); - - // Signal TestScripter to continue from waittestclass + +#else // USE_S60_DOWNLOAD_MANAGER + + // suppress build warning + MPX_DEBUG(_L("CVHPPTestClass::ConnectToDownloadL() : parsing type = %d"), aItem.ParsingType()); + + // Signal TestScripter to continue from waittestclass Signal(); - + #endif // USE_S60_DOWNLOAD_MANAGER - + return err; } @@ -1219,7 +1220,7 @@ MPX_ENTER_EXIT(_L("CVHPPTestClass::SendPdlCustomCommandL"), _L("aCustomCmd = %d"), aCustomCmd ); -#ifdef USE_S60_DOWNLOAD_MANAGER +#ifdef USE_S60_DOWNLOAD_MANAGER CMPXCommand* cmd = CMPXCommand::NewL(); CleanupStack::PushL( cmd ); @@ -1231,12 +1232,12 @@ iPlaybackPlugin->CommandL( *cmd ); CleanupStack::PopAndDestroy( cmd ); - -#else // USE_S60_DOWNLOAD_MANAGER - - // Signal TestScripter to continue from waittestclass + +#else // USE_S60_DOWNLOAD_MANAGER + + // Signal TestScripter to continue from waittestclass Signal(); - + #endif // USE_S60_DOWNLOAD_MANAGER } @@ -1251,8 +1252,8 @@ MPX_ENTER_EXIT(_L("CVHPPTestClass::PauseDownloadL()")); iLog->Log(_L("CVHPPTestClass::PauseDownloadL()")); -#ifdef USE_S60_DOWNLOAD_MANAGER - +#ifdef USE_S60_DOWNLOAD_MANAGER + TCallbackEvent* event = new TCallbackEvent; event->iEvent = EPDownloadStateChanged; @@ -1262,14 +1263,14 @@ AddExpectedEvent( event ); iDlMgrTester->PauseDownload(); - -#else // USE_S60_DOWNLOAD_MANAGER - - // Signal TestScripter to continue from waittestclass + +#else // USE_S60_DOWNLOAD_MANAGER + + // Signal TestScripter to continue from waittestclass Signal(); - -#endif // USE_S60_DOWNLOAD_MANAGER - + +#endif // USE_S60_DOWNLOAD_MANAGER + return KErrNone; } @@ -1284,9 +1285,9 @@ iLog->Log(_L("CVHPPTestClass::ResumeDownloadL()")); TInt err = KErrNone; - -#ifdef USE_S60_DOWNLOAD_MANAGER - + +#ifdef USE_S60_DOWNLOAD_MANAGER + TInt dlSize; err = aItem.GetNextInt( dlSize ); @@ -1313,17 +1314,17 @@ iDlMgrTester->ResumeDownload(); } - -#else // USE_S60_DOWNLOAD_MANAGER - - // suppress build warning - MPX_DEBUG(_L("CVHPPTestClass::ResumeDownloadL() : parsing type = %d"), aItem.ParsingType()); - - // Signal TestScripter to continue from waittestclass + +#else // USE_S60_DOWNLOAD_MANAGER + + // suppress build warning + MPX_DEBUG(_L("CVHPPTestClass::ResumeDownloadL() : parsing type = %d"), aItem.ParsingType()); + + // Signal TestScripter to continue from waittestclass Signal(); - -#endif // USE_S60_DOWNLOAD_MANAGER - + +#endif // USE_S60_DOWNLOAD_MANAGER + return err; } @@ -1337,8 +1338,8 @@ MPX_ENTER_EXIT(_L("CVHPPTestClass::CancelDownloadL()")); iLog->Log(_L("CVHPPTestClass::CancelDownloadL()")); -#ifdef USE_S60_DOWNLOAD_MANAGER - +#ifdef USE_S60_DOWNLOAD_MANAGER + TCallbackEvent* event = new TCallbackEvent; event->iEvent = EPDownloadStateChanged; @@ -1349,13 +1350,13 @@ iDlMgrTester->CancelDownload(); -#else // USE_S60_DOWNLOAD_MANAGER - - // Signal TestScripter to continue from waittestclass +#else // USE_S60_DOWNLOAD_MANAGER + + // Signal TestScripter to continue from waittestclass Signal(); - -#endif // USE_S60_DOWNLOAD_MANAGER - + +#endif // USE_S60_DOWNLOAD_MANAGER + return KErrNone; } @@ -1370,9 +1371,9 @@ iLog->Log(_L("CVHPPTestClass::RetrievePdlStatusL()")); TInt err = KErrNone; - -#ifdef USE_S60_DOWNLOAD_MANAGER - + +#ifdef USE_S60_DOWNLOAD_MANAGER + TInt pdlState; TInt expectedPdlState; TInt downloadedBytes; @@ -1431,16 +1432,16 @@ CleanupStack::PopAndDestroy( cmd ); } -#else // USE_S60_DOWNLOAD_MANAGER - - // suppress build warning - MPX_DEBUG(_L("CVHPPTestClass::RetrievePdlStatusL() : parsing type = %d"), aItem.ParsingType()); - - // Signal TestScripter to continue from waittestclass +#else // USE_S60_DOWNLOAD_MANAGER + + // suppress build warning + MPX_DEBUG(_L("CVHPPTestClass::RetrievePdlStatusL() : parsing type = %d"), aItem.ParsingType()); + + // Signal TestScripter to continue from waittestclass Signal(); - -#endif // USE_S60_DOWNLOAD_MANAGER - + +#endif // USE_S60_DOWNLOAD_MANAGER + return err; } @@ -1622,7 +1623,7 @@ CVHPPTestClass::ProcessEvent( TCallbackEvent* aCallback ) { MPX_ENTER_EXIT(_L("CVHPPTestClass::ProcessEvent")); - + if ( iExpectedCallbackArray->Count() > 0 ) { TCallbackEvent* expectedCallback = (*iExpectedCallbackArray)[0]; @@ -1958,13 +1959,6 @@ TInt err = 0; - //callback event - TCallbackEvent* event = new TCallbackEvent; - event->iError = 0; - event->iData = 0; - event->iEvent = EPPaused; - AddExpectedEvent( event ); - //set phone call as Connected err = RProperty::Set(KPSUidCtsyCallInformation, KCTsyCallState, EPSCTsyCallStateConnected); @@ -2033,14 +2027,7 @@ event->iError = KErrNone; AddExpectedEvent( event ); - - event = new TCallbackEvent; - event->iEvent = EPPaused; - event->iData = 0; - event->iError = KErrNone; - - AddExpectedEvent( event ); - + iAccObserver->UpdateTvOutStatusL( EFalse ); return KErrNone; @@ -2134,69 +2121,69 @@ return err; } -// ----------------------------------------------------------------------------- -// CVHPPTestClass::SetVolumeSteps -// ----------------------------------------------------------------------------- -// -TInt -CVHPPTestClass::SetVolumeSteps( TInt aVolumeSteps ) -{ - MPX_ENTER_EXIT(_L("CVHPPTestClass::SetVolumeSteps()")); - iLog->Log(_L("CVHPPTestClass::SetVolumeSteps()")); - +// ----------------------------------------------------------------------------- +// CVHPPTestClass::SetVolumeSteps +// ----------------------------------------------------------------------------- +// +TInt +CVHPPTestClass::SetVolumeSteps( TInt aVolumeSteps ) +{ + MPX_ENTER_EXIT(_L("CVHPPTestClass::SetVolumeSteps()")); + iLog->Log(_L("CVHPPTestClass::SetVolumeSteps()")); + iPlayerUtility->SetVolumeSteps( aVolumeSteps ); - - return KErrNone; -} - -// ----------------------------------------------------------------------------- -// CVHPPTestClass::HandleVolumeL -// ----------------------------------------------------------------------------- -// -TInt -CVHPPTestClass::HandleVolumeL( CStifItemParser& aItem ) -{ - MPX_ENTER_EXIT(_L("CVHPPTestClass::HandleVolumeL()")); - iLog->Log(_L("CVHPPTestClass::HandleVolumeL()")); - - TInt command; - TInt value; - + + return KErrNone; +} + +// ----------------------------------------------------------------------------- +// CVHPPTestClass::HandleVolumeL +// ----------------------------------------------------------------------------- +// +TInt +CVHPPTestClass::HandleVolumeL( CStifItemParser& aItem ) +{ + MPX_ENTER_EXIT(_L("CVHPPTestClass::HandleVolumeL()")); + iLog->Log(_L("CVHPPTestClass::HandleVolumeL()")); + + TInt command; + TInt value; + TInt err = aItem.GetNextInt( command ); if ( err == KErrNone ) { err = aItem.GetNextInt( value ); - if ( err == KErrNone ) - { - // - // assign callback event values - // - TCallbackEvent* event = new TCallbackEvent; - event->iEvent = EPVolumeChanged; - event->iData = value; - event->iError = KErrNone; - - // - // save expected result to be compared later - // - AddExpectedEvent( event ); - + if ( err == KErrNone ) + { + // + // assign callback event values + // + TCallbackEvent* event = new TCallbackEvent; + event->iEvent = EPVolumeChanged; + event->iData = value; + event->iError = KErrNone; + + // + // save expected result to be compared later + // + AddExpectedEvent( event ); + // // send command to playback plugin // - CreateVideoPlaybackCommandL( aItem, (TMPXVideoPlaybackCommand)command ); - } + CreateVideoPlaybackCommandL( aItem, (TMPXVideoPlaybackCommand)command ); + } } - + if ( err == KErrNone ) { MPX_DEBUG(_L("CVHPPTestClass::HandleVolumeL() leaves with proper error")); } - - return err; -} + + return err; +} TInt @@ -2208,7 +2195,7 @@ TInt duration; TInt volumeSteps; TInt position; - + TInt err = aItem.GetNextInt( duration ); if ( err == KErrNone ) @@ -2224,36 +2211,36 @@ AddExpectedEvent( event ); - // + // // read number of volume steps // err = aItem.GetNextInt( volumeSteps ); - + if ( err == KErrNone ) - { + { // // set volume steps // SetVolumeSteps( volumeSteps ); - + err = aItem.GetNextInt( position ); - + if (err == KErrNone ) { - TBuf<120> fullPath; + TBuf<120> fullPath; err = ReadFileInitializationParameters( aItem, fullPath ); - + if ( err == KErrNone ) { PreparePluginL(); - + // // Initalize the Plugin with a file name // MPX_DEBUG(_L("Initialize the Plugin: filename = %S, position = %d"), &fullPath, position); iLog->Log(_L("Initialize the Plugin: filename = %S, position = %d"), &fullPath, position); - + iPlaybackPlugin->InitialiseWithPositionL( fullPath, position ); } @@ -2274,7 +2261,7 @@ TInt duration; TInt volumeSteps; TInt position; - + TInt err = aItem.GetNextInt( duration ); if ( err == KErrNone ) @@ -2290,44 +2277,44 @@ AddExpectedEvent( event ); - // + // // read number of volume steps // err = aItem.GetNextInt( volumeSteps ); - + if ( err == KErrNone ) - { + { // // set volume steps // SetVolumeSteps( volumeSteps ); - + err = aItem.GetNextInt( position ); - + if ( err == KErrNone ) { TPtrC link; - + // // Read in the link from the config file // TInt err = aItem.GetNextString( link ); - + if ( err == KErrNone ) { TInt err = ReadInitializationErrors( aItem ); - + if ( err == KErrNone ) { PreparePluginL(); - + // // Extract the streaming link from the ram file and // Initalize the Plugin with the link and an access point // MPX_DEBUG(_L("Initialize the Plugin: link = %S, position = %d"), &link, position); iLog->Log(_L("Initialize the Plugin: link = %S, position = %d"), &link, position); - + iPlaybackPlugin->InitStreamingL( link, KNullDesC8, 11, position ); } } @@ -2349,41 +2336,41 @@ TInt volumeSteps; TInt position; TInt fileHandle32; - + TInt err = aItem.GetNextInt( fileHandle32 ); - + if ( err == KErrNone ) - { - + { + #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API // // set RFile as default if the 64-bit flag is not defined // fileHandle32 = ETrue; #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - + err = aItem.GetNextInt( duration ); - + if ( err == KErrNone ) { // // We will always get an Init Complete message out // TCallbackEvent* event = new TCallbackEvent; - + event->iEvent = EPInitialised; event->iData = duration; event->iError = KErrNone; - + AddExpectedEvent( event ); - - // + + // // read number of volume steps // err = aItem.GetNextInt( volumeSteps ); - + if ( err == KErrNone ) - { + { // // set volume steps // @@ -2394,16 +2381,16 @@ if (err == KErrNone ) { TBuf<120> fullPath; - + err = ReadFileInitializationParameters( aItem, fullPath ); - + if ( err == KErrNone ) { PreparePluginL(); - + RFs fs; TInt error = fs.Connect(); - + // // Open a file handle to the clip // @@ -2423,20 +2410,20 @@ file64.Close(); } #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - + // // Initalize the Plugin with a file name // MPX_DEBUG(_L("Initialize the Plugin with File Handle: filename = %S, position = %d"), &fullPath, position); iLog->Log(_L("Initialize the Plugin with File Handle: filename = %S, position = %d"), &fullPath, position); - + fs.Close(); } - } - - } - } - } + } + + } + } + } return err; } @@ -2450,97 +2437,97 @@ TInt duration; TInt volumeSteps; TInt fileHandle32; - + TInt err = aItem.GetNextInt( fileHandle32 ); - + if ( err == KErrNone ) - { - + { + #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API // // set RFile as default if the 64-bit flag is not defined // fileHandle32 = ETrue; #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - + err = aItem.GetNextInt( duration ); - + if ( err == KErrNone ) { // // We will always get an Init Complete message out // TCallbackEvent* event = new TCallbackEvent; - + event->iEvent = EPInitialised; event->iData = duration; event->iError = KErrNone; - + AddExpectedEvent( event ); - - // + + // // read number of volume steps // err = aItem.GetNextInt( volumeSteps ); - + if ( err == KErrNone ) - { + { // // set volume steps // SetVolumeSteps( volumeSteps ); - + TBuf<120> fullPath; err = ReadFileInitializationParameters( aItem, fullPath ); if ( err == KErrNone ) { - PreparePluginL(); - - MPX_DEBUG( _L("Initialize the Plugin: link = %S"), &fullPath ); - iLog->Log( _L("Initialize the Plugin: link = %S"), &fullPath ); - - // - // Extract the streaming link from the ram file and - // Initalize the Plugin with the file handle and an access point - // - RFs fs; - TInt error = fs.Connect(); - - if ( fileHandle32 ) - { - RFile file; - error = file.Open( fs, fullPath, EFileRead | EFileShareAny ); - - MPX_DEBUG( _L("Initialize the Plugin: file open error = %d"), - error ); - - User::LeaveIfError( error ); - - iPlaybackPlugin->InitStreamingL( file, 11 ); - file.Close(); - } + PreparePluginL(); + + MPX_DEBUG( _L("Initialize the Plugin: link = %S"), &fullPath ); + iLog->Log( _L("Initialize the Plugin: link = %S"), &fullPath ); + + // + // Extract the streaming link from the ram file and + // Initalize the Plugin with the file handle and an access point + // + RFs fs; + TInt error = fs.Connect(); + + if ( fileHandle32 ) + { + RFile file; + error = file.Open( fs, fullPath, EFileRead | EFileShareAny ); + + MPX_DEBUG( _L("Initialize the Plugin: file open error = %d"), + error ); + + User::LeaveIfError( error ); + + iPlaybackPlugin->InitStreamingL( file, 11 ); + file.Close(); + } #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - else - { - RFile64 file64; - error = file64.Open( fs, fullPath, EFileRead | EFileShareAny ); - - MPX_DEBUG( _L("Initialize the Plugin: file open error = %d"), - error ); - - User::LeaveIfError( error ); - - iPlaybackPlugin->InitStreaming64L( file64, 11 ); - file64.Close(); - } + else + { + RFile64 file64; + error = file64.Open( fs, fullPath, EFileRead | EFileShareAny ); + + MPX_DEBUG( _L("Initialize the Plugin: file open error = %d"), + error ); + + User::LeaveIfError( error ); + + iPlaybackPlugin->InitStreaming64L( file64, 11 ); + file64.Close(); + } #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API - - fs.Close(); + + fs.Close(); } - } - } - } + } + } + } return err; } @@ -2550,10 +2537,10 @@ MPX_ENTER_EXIT( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") ); iLog->Log( _L("CVHPPTestClass::RetrieveFileNameAndModeL()") ); - TBuf<120> fullPath; - TPtrC fileName; - TInt err; - + TBuf<120> fullPath; + TPtrC fileName; + TInt err; + err = aItem.GetNextString( fileName ); if ( err == KErrNone ) @@ -2563,38 +2550,38 @@ // fullPath.Append( KVideoTestPath ); fullPath.Append( fileName ); - + TInt mode; err = aItem.GetNextInt( mode); - + if ( err == KErrNone ) { - CMPXCommand* cmd = CMPXCommand::NewL(); - CleanupStack::PushL( cmd ); - - cmd->SetTObjectValueL( KMPXCommandGeneralDoSync, ETrue ); - cmd->SetTObjectValueL( KMPXCommandGeneralId, - KMPXMediaIdVideoPlayback ); - cmd->SetTObjectValueL( KMPXMediaVideoPlaybackCommand, EPbCmdInitView ); - - iPlaybackPlugin->CommandL( *cmd ); - - TPtrC clipName( cmd->ValueText( KMPXMediaVideoPlaybackFileName ) ); - TMPXVideoMode playbackMode = (TMPXVideoMode) cmd->ValueTObjectL( KMPXMediaVideoMode ); - - MPX_DEBUG( _L(" Expected Data: filename = %S, playbackmode= %d" ), - &fullPath, mode ); - - MPX_DEBUG( _L(" Retrieved Data: filename = %S, playbackmode= %d"), - &clipName, playbackMode ); - - if ( fullPath.Compare( clipName) != 0 || mode != playbackMode ) - { - err = KErrGeneral; - MPX_DEBUG( _L(" err = %d"), err ); - } - - CleanupStack::PopAndDestroy( cmd ); + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + + cmd->SetTObjectValueL( KMPXCommandGeneralDoSync, ETrue ); + cmd->SetTObjectValueL( KMPXCommandGeneralId, + KMPXMediaIdVideoPlayback ); + cmd->SetTObjectValueL( KMPXMediaVideoPlaybackCommand, EPbCmdInitView ); + + iPlaybackPlugin->CommandL( *cmd ); + + TPtrC clipName( cmd->ValueText( KMPXMediaVideoPlaybackFileName ) ); + TMPXVideoMode playbackMode = (TMPXVideoMode) cmd->ValueTObjectL( KMPXMediaVideoMode ); + + MPX_DEBUG( _L(" Expected Data: filename = %S, playbackmode= %d" ), + &fullPath, mode ); + + MPX_DEBUG( _L(" Retrieved Data: filename = %S, playbackmode= %d"), + &clipName, playbackMode ); + + if ( fullPath.Compare( clipName) != 0 || mode != playbackMode ) + { + err = KErrGeneral; + MPX_DEBUG( _L(" err = %d"), err ); + } + + CleanupStack::PopAndDestroy( cmd ); } } diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrol.cpp --- a/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrol.cpp Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrol.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 25 % +// Version : %version: 23.1.1 % // INCLUDE FILES @@ -332,7 +332,6 @@ } break; } - case EPbStateInitialised: case EPbStateBuffering: { if ( iProperties & EMPXBufferingControl ) diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolpolicy.cpp --- a/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolpolicy.cpp Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolpolicy.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -15,8 +15,7 @@ * */ - -// Version : %version: 10 % +// Version : %version: 9 % // INCLUDE FILES @@ -95,7 +94,16 @@ // // Transitory Buffering states will be filtered out by the View // - aProperties = EMPXBufferingControl | EMPXShownWhenInitializing; + aProperties = EMPXBufferingControl; + + // + // Do not show Back when Initializing for Local Mode + // It causes a flicker when playback begins + // + if ( aDetails->iPlaybackMode != EMPXVideoLocal ) + { + aProperties += EMPXShownWhenInitializing; + } } case EMPXSoftkeyDetails: { @@ -109,16 +117,6 @@ case EMPXBufferingLabel: { aProperties = EMPXBufferingControl; - - // - // Show Loading when Initializing for local playback modes - // This allows for a smoother transition to playing state - // - if ( aDetails->iPlaybackMode == EMPXVideoLocal || - aDetails->iPlaybackMode == EMPXVideoProgressiveDownload ) - { - aProperties += EMPXShownWhenInitializing; - } break; } case EMPXTitleLabel: diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolscontroller.cpp --- a/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolscontroller.cpp Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackcontrolscontroller.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 45 % +// Version : %version: 44 % // INCLUDE FILES @@ -117,18 +117,10 @@ iFileDetails = aDetails; iTvOutConnected = iFileDetails->iTvOutConnected; + iShowControls = ETrue; iRNFormat = IsRealFormatL( iFileDetails->iClipName->Des() ); - if ( IsRealOneBitmapVisible() ) - { - iShowControls = EFalse; - } - else - { - iShowControls = ETrue; - } - iControlsPolicy = CMPXVideoPlaybackControlPolicy::NewL(); iControlsConfig = CMPXVideoPlaybackControlConfiguration::NewL( this ); @@ -365,13 +357,8 @@ case EMPXControlCmdHandleForegroundEvent: { MPX_DEBUG(_L(" [EMPXControlCmdHandleForegroundEvent]")); - - if ( ! IsRealOneBitmapVisible() ) - { - iShowControls = ETrue; - UpdateControlsVisibility(); - } - + iShowControls = ETrue; + UpdateControlsVisibility(); break; } case EMPXControlCmdHandleErrors: @@ -1789,39 +1776,7 @@ if ( iRealOneBitmap ) { iRealOneBitmap->MakeVisible( aVisible ); - - if ( ! aVisible ) - { - // HDMI/TV-out cable connected then show the controls - if ( iTvOutConnected && !iShowControls ) - { - iShowControls = ETrue; - UpdateControlsVisibility(); - } - else - { - iShowControls = ETrue; - } - } - }// iRealOneBitmap -} - -// ------------------------------------------------------------------------------------------------- -// CMPXVideoPlaybackControlsController::IsRealOneBitmapVisible() -// ------------------------------------------------------------------------------------------------- -// -TBool CMPXVideoPlaybackControlsController::IsRealOneBitmapVisible() -{ - TBool visible = EFalse; - - if ( iRealOneBitmap ) - { - visible = iRealOneBitmap->IsVisible(); } - - MPX_DEBUG(_L("CMPXVideoPlaybackControlsController::IsRealOneBitmapVisible(%d)"), visible); - - return visible; } // ------------------------------------------------------------------------------------------------- diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/videoplaybackcontrols/src/mpxvideoplaybackmediadetailsviewer.cpp --- a/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackmediadetailsviewer.cpp Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackmediadetailsviewer.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 18 % +// Version : %version: e003sa33#17 % // INCLUDE FILES @@ -65,7 +65,6 @@ CMPXVideoPlaybackMediaDetailsViewer::CMPXVideoPlaybackMediaDetailsViewer( CMPXVideoPlaybackControlsController* aController ) : iController( aController ) - , iDrmDetailsLaunched( EFalse ) { } @@ -239,12 +238,7 @@ // void CMPXVideoPlaybackMediaDetailsViewer::LaunchDRMDetailsL() { - if ( ! iDrmDetailsLaunched ) - { - iDrmDetailsLaunched = ETrue; - iController->iContainer->HandleCommandL( EMPXPbvLaunchDRMDetails ); - iDrmDetailsLaunched = EFalse; - } + iController->iContainer->HandleCommandL(EMPXPbvLaunchDRMDetails); } // ------------------------------------------------------------------------------------------------- @@ -313,10 +307,10 @@ CleanupStack::PopAndDestroy( heading ); } - + // Title HBufC* fileTitle = iController->FileDetails()->GenerateFileTitleL(); - + if ( fileTitle && fileTitle->Length() ) { // Title gets populated by UpdateTitle method @@ -328,7 +322,7 @@ iTitleLabel->MakeVisible( ETrue ); rowsAdded++; } - + delete fileTitle; // Filename @@ -345,9 +339,9 @@ iClipnameLabel->MakeVisible( ETrue ); rowsAdded++; } - + delete fileName; - + // Mime Type (Format) if ( iController->FileDetails()->iMimeType && iController->FileDetails()->iMimeType->Length() ) { @@ -703,7 +697,7 @@ { UpdateFilenameL(); } - + if ( iTitleScroller.IsUpdateNeeded() ) { UpdateTitleL(); @@ -761,8 +755,8 @@ } HBufC* title = NULL; - TRAP_IGNORE ( title = iController->FileDetails()->GenerateFileTitleL() ); - + TRAP_IGNORE ( title = iController->FileDetails()->GenerateFileTitleL() ); + if ( title ) { numOfItems++; @@ -849,10 +843,10 @@ void CMPXVideoPlaybackMediaDetailsViewer::UpdateFilenameL() { MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackMediaDetailsViewer::UpdateFilenameL" ) ); - - HBufC* fileName = iController->FileDetails()->GenerateFileNameL(); + + HBufC* fileName = iController->FileDetails()->GenerateFileNameL(); CleanupStack::PushL( fileName ); - + if ( fileName && fileName->Length() ) { HBufC* heading = iEikonEnv->AllocReadResourceL( R_MPX_FILENAME_HEADING ); @@ -871,7 +865,7 @@ CleanupStack::PopAndDestroy( heading ); } - + CleanupStack::PopAndDestroy( fileName ); } @@ -882,11 +876,11 @@ void CMPXVideoPlaybackMediaDetailsViewer::UpdateTitleL() { MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackMediaDetailsViewer::UpdateTitleL" ) ); - - HBufC* fileTitle = iController->FileDetails()->GenerateFileTitleL(); + + HBufC* fileTitle = iController->FileDetails()->GenerateFileTitleL(); CleanupStack::PushL( fileTitle ); - - if ( fileTitle && fileTitle->Length() ) + + if ( fileTitle && fileTitle->Length() ) { HBufC* heading = iEikonEnv->AllocReadResourceL( R_MPX_TITLE_HEADING ); CleanupStack::PushL( heading ); @@ -904,8 +898,8 @@ CleanupStack::PopAndDestroy( heading ); } - - CleanupStack::PopAndDestroy( fileTitle ); + + CleanupStack::PopAndDestroy( fileTitle ); } // ------------------------------------------------------------------------------------------------- @@ -946,8 +940,8 @@ TBool CMPXVideoPlaybackMediaDetailsViewer::TTextScroller::IsUpdateNeeded() { MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackMediaDetailsViewer::TTextScroller::IsUpdateNeeded" ) ); - - // skip the scrolling operation if the loop for delay is going on + + // skip the scrolling operation if the loop for delay is going on TBool skipForTimerDelay = EFalse; // add a delay after each complete scrolling @@ -983,12 +977,12 @@ TDes& aDesText ) { MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackMediaDetailsViewer::TTextScroller::ScrollText" ) ); - - if ( 0 == iSrcTextLen ) + + if ( 0 == iSrcTextLen ) { iSrcTextLen = aSrcText.Length(); } - + ASSERT( aSrcText.Length() == iSrcTextLen ); if ( aSrcText.Length() >= KMediaDetailsViewerVisibleCharacters ) { @@ -1005,7 +999,7 @@ iTextScrollPos++; } iScroll = ETrue; - + } else { diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/videoplaybackcontrols/src/mpxvideoplaybackprogressbar.cpp --- a/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackprogressbar.cpp Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackprogressbar.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 25 % +// Version : %version: e003sa33#24 % // INCLUDE FILES @@ -772,8 +772,7 @@ EAspectRatioNotPreserved ); } } - else if ( aDetails->iPlaybackMode == EMPXVideoLiveStreaming && - ! iLiveStreamingString ) + else if ( aDetails->iPlaybackMode == EMPXVideoLiveStreaming ) { iLiveStreamingString = iEikonEnv->AllocReadResourceL( R_MPX_LIVE_STREAMING ); diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/videoplaybackcontrols/src/mpxvideoplaybackvolumebar.cpp --- a/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackvolumebar.cpp Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayback/videoplaybackcontrols/src/mpxvideoplaybackvolumebar.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 27 % +// Version : %version: 25 % // INCLUDE FILES @@ -457,9 +457,13 @@ case TPointerEvent::EButtonRepeat: { #ifdef RD_TACTILE_FEEDBACK - if ( iFeedback && !iController->FileDetails()->iTvOutConnected ) + if ( iFeedback ) { +#ifdef SYMBIAN_BUILD_GCE iFeedback->InstantFeedback( ETouchFeedbackSlider ); +#else + iFeedback->InstantFeedback( ETouchFeedbackSensitive ); +#endif //SYMBIAN_BUILD_GCE } #endif //RD_TACTILE_FEEDBACK iController->HandleCommandL( EMPXPbvCmdIncreaseVolume ); @@ -482,9 +486,13 @@ case TPointerEvent::EButton1Up: { #ifdef RD_TACTILE_FEEDBACK - if ( iFeedback && !iController->FileDetails()->iTvOutConnected ) + if ( iFeedback ) { +#ifdef SYMBIAN_BUILD_GCE iFeedback->InstantFeedback( ETouchFeedbackSlider ); +#else + iFeedback->InstantFeedback( ETouchFeedbackBasic ); +#endif //SYMBIAN_BUILD_GCE } #endif //RD_TACTILE_FEEDBACK @@ -511,9 +519,13 @@ case TPointerEvent::EButtonRepeat: { #ifdef RD_TACTILE_FEEDBACK - if ( iFeedback && !iController->FileDetails()->iTvOutConnected ) + if ( iFeedback ) { +#ifdef SYMBIAN_BUILD_GCE iFeedback->InstantFeedback( ETouchFeedbackSlider ); +#else + iFeedback->InstantFeedback( ETouchFeedbackSensitive ); +#endif //SYMBIAN_BUILD_GCE } #endif //RD_TACTILE_FEEDBACK iController->HandleCommandL( EMPXPbvCmdDecreaseVolume ); @@ -536,9 +548,13 @@ case TPointerEvent::EButton1Up: { #ifdef RD_TACTILE_FEEDBACK - if ( iFeedback && !iController->FileDetails()->iTvOutConnected ) + if ( iFeedback ) { +#ifdef SYMBIAN_BUILD_GCE iFeedback->InstantFeedback( ETouchFeedbackSlider ); +#else + iFeedback->InstantFeedback( ETouchFeedbackBasic ); +#endif //SYMBIAN_BUILD_GCE } #endif //RD_TACTILE_FEEDBACK @@ -567,7 +583,11 @@ #ifdef RD_TACTILE_FEEDBACK if ( iFeedback ) { +#ifdef SYMBIAN_BUILD_GCE iFeedback->InstantFeedback( ETouchFeedbackBasicButton ); +#else + iFeedback->InstantFeedback( ETouchFeedbackBasic ); +#endif //SYMBIAN_BUILD_GCE } #endif //RD_TACTILE_FEEDBACK @@ -636,7 +656,7 @@ case TPointerEvent::EButton1Down: { #ifdef RD_TACTILE_FEEDBACK - if ( iFeedback && !iController->FileDetails()->iTvOutConnected ) + if ( iFeedback ) { iFeedback->InstantFeedback( ETouchFeedbackSlider ); } @@ -657,8 +677,7 @@ case TPointerEvent::EDrag: { #ifdef RD_TACTILE_FEEDBACK - if ( iFeedback && giveDynamicSliderFeedback && - !iController->FileDetails()->iTvOutConnected ) + if ( iFeedback && giveDynamicSliderFeedback ) { iFeedback->StartFeedback( this, ETouchDynamicSlider, diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/conf/ui_videoplaybackcontrolstest.cfg --- a/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/conf/ui_videoplaybackcontrolstest.cfg Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayback/videoplaybackcontrols/tsrc/videoplaybackcontrols_test/conf/ui_videoplaybackcontrolstest.cfg Wed Oct 13 14:34:36 2010 +0300 @@ -164,7 +164,34 @@ [Endtest] [Test] -title [6]Mute / Unmute +title [6]Set volume to 25 +bringtoforeground +create ui_videoplaybackcontrolstest ControlsTest +ControlsTest CreateControls test.3gp EMPXVideoLocal +pause 100 +ControlsTest AddDefaultFileDetails +pause 100 +ControlsTest SetState EPbStatePlaying +ControlsTest SetVolume 50 +pause 100 +ControlsTest ShowControls +pause 1000 +ControlsTest PointerEvent eventtype=EButton1Down x=75 y=180 +pause 200 +ControlsTest PointerEvent eventtype=EDrag x=75 y=180 +pause 100 +ControlsTest PointerEvent eventtype=EButton1Up x=75 y=180 +pause 100 +ControlsTest ExpectedResult EMPXPbvCmdSetVolume 25 +pause 100 +ControlsTest DeleteControls +delete ControlsTest +sendtobackground +pause 2000 +[Endtest] + +[Test] +title [7]Mute / Unmute bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -197,7 +224,7 @@ [Endtest] [Test] -title [7]SetPosition +title [8]SetPosition bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -223,7 +250,7 @@ [Endtest] [Test] -title [8]Audio only clip +title [9]Audio only clip bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -245,7 +272,7 @@ [Endtest] [Test] -title [9]Play using Button bar +title [10]Play using Button bar bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -267,7 +294,7 @@ [Endtest] [Test] -title [10]Pause using Button bar +title [11]Pause using Button bar bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -291,7 +318,7 @@ [Endtest] [Test] -title [11]FF using Button bar +title [12]FF using Button bar bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -316,7 +343,7 @@ [Endtest] [Test] -title [12]RW using Button bar +title [13]RW using Button bar bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -341,7 +368,7 @@ [Endtest] [Test] -title [13]PDL SetDownLoadPostion +title [14]PDL SetDownLoadPostion bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoProgressiveDownload @@ -364,7 +391,7 @@ [Endtest] [Test] -title [14]PDL SetDownLoadPaused +title [15]PDL SetDownLoadPaused bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoProgressiveDownload @@ -382,7 +409,7 @@ [Endtest] [Test] -title [15]PDL ClearDownLoadPaused +title [16]PDL ClearDownLoadPaused bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoProgressiveDownload @@ -405,7 +432,7 @@ [Endtest] [Test] -title [16]TV-Out +title [17]TV-Out bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -425,7 +452,7 @@ [Endtest] [Test] -title [17] RealMedia Streaming +title [18] RealMedia Streaming bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls rtsp:\/\/1.1.1.1/1.rm EMPXVideoStreaming @@ -441,7 +468,7 @@ [Endtest] [Test] -title [18] 3GPP Streaming +title [19] 3GPP Streaming bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls rtsp:\/\/1.1.1.1/1.3gp EMPXVideoStreaming @@ -457,7 +484,7 @@ [Endtest] [Test] -title [19] Error during Connecting +title [20] Error during Connecting bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.rm EMPXVideoStreaming @@ -473,7 +500,7 @@ [Endtest] [Test] -title [20]Play/pause using enter key +title [21]Play/pause using enter key bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -497,7 +524,7 @@ [Endtest] [Test] -title [21] Key input while FF via pointer event in progress +title [22] Key input while FF via pointer event in progress bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -524,7 +551,7 @@ [Endtest] [Test] -title [22] Ptr input while key input being processed +title [23] Ptr input while key input being processed bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -552,7 +579,7 @@ [Endtest] [Test] -title [23] Press back key through offerkeyevent +title [24] Press back key through offerkeyevent bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -576,7 +603,7 @@ [Endtest] [Test] -title [24]Press details key through offerkeyevent +title [25]Press details key through offerkeyevent bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -598,7 +625,7 @@ [Endtest] [Test] -title [25]Send the view to background while FF using Button bar +title [26]Send the view to background while FF using Button bar bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -623,7 +650,7 @@ [Endtest] [Test] -title [26]Tap on back softkey while buffering in live streaming mode +title [27]Tap on back softkey while buffering in live streaming mode bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls rtsp:\/\/1.1.1.1/1.3gp EMPXVideoLiveStreaming @@ -645,7 +672,7 @@ [Endtest] [Test] -title [27]Timout for toggling control's visibility in playing state +title [28]Timout for toggling control's visibility in playing state bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -663,7 +690,7 @@ [Endtest] [Test] -title [28]SetPosition when playing +title [29]SetPosition when playing bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -696,7 +723,7 @@ [Test] -title [29] Open Close Media Details Viewer (no scrolling) +title [30] Open Close Media Details Viewer (no scrolling) bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -719,7 +746,7 @@ [Test] -title [30] Open Close Media Details Viewer w/Scrolling +title [31] Open Close Media Details Viewer w/Scrolling bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls TestClipWithLongNameToTestScrollingInMediaDetailsViewer.3gp EMPXVideoLocal @@ -742,7 +769,7 @@ [Test] -title [31] Media Details Viewer (audio only) +title [32] Media Details Viewer (audio only) bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls TestClipWithLongNameToTestScrollingInMediaDetailsViewer.3gp EMPXVideoLocal @@ -765,7 +792,7 @@ [Test] -title [32] Media Details Viewer Streaming Link +title [33] Media Details Viewer Streaming Link bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls rtsp:\/\/1.1.1.1/1.3gp EMPXVideoStreaming @@ -787,7 +814,7 @@ [Endtest] [Test] -title [33] Open Close Media Details Viewer (with long details) +title [34] Open Close Media Details Viewer (with long details) bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -809,7 +836,7 @@ [Endtest] [Test] -title [34] Hide aspect ratio +title [35] Hide aspect ratio bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls test.3gp EMPXVideoLocal @@ -831,7 +858,7 @@ [Endtest] [Test] -title [35] Open Close Media Details Viewer (with empty title) +title [36] Open Close Media Details Viewer (with empty title) bringtoforeground create ui_videoplaybackcontrolstest ControlsTest ControlsTest CreateControls rtsp:\/\/10.41.2.3/h264/Video%20BitRate%2008%20-%2064/Meat%20Loaf%20-%20I%20would%20do%20anything%20for%20love.3gp EMPXVideoStreaming diff -r 3eb824b18d67 -r 375929f879c2 videoplayback/videoplaybackviews/src/mpxvideobaseplaybackview.cpp --- a/videoplayback/videoplaybackviews/src/mpxvideobaseplaybackview.cpp Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayback/videoplaybackviews/src/mpxvideobaseplaybackview.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 88 % +// Version : %version: 86 % // Include Files @@ -966,7 +966,7 @@ } case KMPXVideoCallOngoingError: { - DisplayInfoMessageL( R_MPX_VIDEO_CALL_ONGOING, ETrue ); + DisplayInfoMessageL( R_MPX_VIDEO_CALL_ONGOING ); break; } default: @@ -1550,15 +1550,7 @@ void CMPXVideoBasePlaybackView::DoClosePlayerL() { MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::DoClosePlayerL()")); - - if ( iExitPlayer ) - { - AppUi()->HandleCommandL( EAknCmdExit ); - } - else - { - AppUi()->HandleCommandL( EAknSoftkeyBack ); - } + AppUi()->HandleCommandL( EAknSoftkeyBack ); } // ------------------------------------------------------------------------------------------------- @@ -1868,8 +1860,6 @@ { MPX_ENTER_EXIT(_L("CMPXVideoBasePlaybackView::HandleDrmErrorsL()")); - TInt drmUiError = KErrNone; - // // If we receive an error when we are initialized, let the DRM UI Handler // process the error. If we have been playing, display the error message @@ -1893,11 +1883,10 @@ DRM::CDrmUiHandling* drmUiHandling = DRM::CDrmUiHandling::NewL( iCoeEnv ); CleanupStack::PushL( drmUiHandling ); - MPX_TRAP( drmUiError, - drmUiHandling->GetErrorHandler().HandleErrorL( fileHandle, - ContentAccess::EPlay, - aError, - NULL ) ); + drmUiHandling->GetErrorHandler().HandleErrorL( fileHandle, + ContentAccess::EPlay, + aError, + NULL ); CleanupStack::PopAndDestroy( drmUiHandling ); } @@ -1914,12 +1903,10 @@ DRM::CDrmUiHandling* drmUiHandling = DRM::CDrmUiHandling::NewL( iCoeEnv ); CleanupStack::PushL( drmUiHandling ); - MPX_TRAP( drmUiError, - drmUiHandling->GetErrorHandler().HandleErrorL( fileHandle64, - ContentAccess::EPlay, - aError, - NULL ) ); - + drmUiHandling->GetErrorHandler().HandleErrorL( fileHandle64, + ContentAccess::EPlay, + aError, + NULL ); CleanupStack::PopAndDestroy( drmUiHandling ); } else @@ -1938,19 +1925,7 @@ CleanupStack::PopAndDestroy(); // fileHandle } - if ( KErrNone == drmUiError ) - { - HandleClosePlaybackViewL(); - } - else if ( KLeaveExit == drmUiError ) - { - iExitPlayer = ETrue; - ActivateClosePlayerActiveObject(); - } - else - { - User::Leave( drmUiError ); - } + HandleClosePlaybackViewL(); } // ------------------------------------------------------------------------------------------------- diff -r 3eb824b18d67 -r 375929f879c2 videoplayerapp/mpxvideoplayer/group/mpxvideoplayer.mmp --- a/videoplayerapp/mpxvideoplayer/group/mpxvideoplayer.mmp Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayerapp/mpxvideoplayer/group/mpxvideoplayer.mmp Wed Oct 13 14:34:36 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 29 % +// Version : %version: da1mmcf#28 % #include #include @@ -37,7 +37,6 @@ SOURCE mpxvideoplayerappui.cpp SOURCE mpxvideoplayerappuiengine.cpp SOURCE mpxvideoembeddedpdlhandler.cpp -SOURCE mpxvideoplayeriadupdate.cpp START RESOURCE ../data/mpxvideoplayer.rss HEADER @@ -82,7 +81,5 @@ LIBRARY mpxcommon.lib LIBRARY flogger.lib LIBRARY videoplaylistutility.lib -LIBRARY featmgr.lib -LIBRARY iaupdateapi.lib // End of File diff -r 3eb824b18d67 -r 375929f879c2 videoplayerapp/mpxvideoplayer/inc/mpxvideoplayerappuiengine.h --- a/videoplayerapp/mpxvideoplayer/inc/mpxvideoplayerappuiengine.h Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayerapp/mpxvideoplayer/inc/mpxvideoplayerappuiengine.h Wed Oct 13 14:34:36 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 35 % +// Version : %version: da1mmcf#34 % #ifndef CMPXVIDEOPLAYERAPPUIENGINE_H @@ -43,7 +43,6 @@ class MMPXCollectionUiHelper; class CAiwGenericParamList; class CVideoPlaylistUtility; -class CMpxVideoPlayerIadUpdate; /** * Application UI class. @@ -315,11 +314,6 @@ */ virtual void DoLateConstructL(); - /** - * Checks for updates via IAD. - */ - void DoCheckForUpdatesL(); - private: // data CMpxVideoPlayerAppUi* iAppUi; @@ -336,7 +330,6 @@ CIdle* iExitAo; CMediaRecognizer* iRecognizer; // own CMpxVideoEmbeddedPdlHandler* iPdlHandler; // own - CMpxVideoPlayerIadUpdate* iIadUpdate; // own TInt iAccessPointId; TBool iMultilinkPlaylist; diff -r 3eb824b18d67 -r 375929f879c2 videoplayerapp/mpxvideoplayer/inc/mpxvideoplayeriadupdate.h --- a/videoplayerapp/mpxvideoplayer/inc/mpxvideoplayeriadupdate.h Wed Sep 15 12:15:24 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,148 +0,0 @@ -/* -* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: IAD update handling. -* -*/ - - -// Version : %version: 1 % - - -#ifndef CMPXVIDEOPLAYERIADUPDATE_H -#define CMPXVIDEOPLAYERIADUPDATE_H - -#include -#include - -class CIAUpdate; -class CIAUpdateParameters; -class MMPXViewUtility; - - -/** - * This class handles IAD update. - */ -NONSHARABLE_CLASS( CMpxVideoPlayerIadUpdate ) : public CBase, public MIAUpdateObserver - { - -public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param aViewUtility Reference to view utility - */ - static CMpxVideoPlayerIadUpdate* NewL( MMPXViewUtility& aViewUtility ); - - /** - * Destructor. - */ - virtual ~CMpxVideoPlayerIadUpdate(); - -public: // New methods - - /** - * Start IAD update process. - */ - void StartL(); - -private: // Constructors and destructor - - /** - * C++ default constructor. - * @param aViewUtility Reference to view utility - */ - CMpxVideoPlayerIadUpdate( MMPXViewUtility& aViewUtility ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - -private: // New methods - - /** - * From MIAUpdateObserver. - * This callback function is called when the update checking operation has completed. - * - * @param aErrorCode The error code of the observed update operation. - * KErrNone for successful completion, - * otherwise a system wide error code. - * @param aAvailableUpdates Number of the updates that were found available. - * - * @since S60 v3.2 - */ - void CheckUpdatesComplete( TInt aErrorCode, TInt aAvailableUpdates ); - - - /** - * From MIAUpdateObserver. - * This callback function is called when an update operation has completed. - * Even if multiple functions are provided to start different update operations, - * this callback function is always called after an update operation has completed. - * - * @param aErrorCode The error code of the completed update operation. - * KErrNone for successful completion, - * otherwise a system wide error code. - * @param aResult Details about the completed update operation. - * Ownership is transferred. - * - * @since S60 v3.2 - */ - void UpdateComplete( TInt aErrorCode, CIAUpdateResult* aResultDetails ); - - - /** - * From MIAUpdateObserver. - * This callback function is called when an update query operation has completed. - * - * @param aErrorCode The error code of the observed query operation. - * KErrNone for successful completion, - * otherwise a system wide error code. - * @param aUpdateNow ETrue informs that an update operation should be started. - * EFalse informs that there is no need to start an update - * operation. - * @since Series 60 3.2 - */ - void UpdateQueryComplete( TInt aErrorCode, TBool aUpdateNow ); - - - /** - * Parses SDP file. - * @since Series 60 3.2 - * @param none. - * @return none. - */ - void Delete(); - -private: // Data - - /** - * IAD update API. - */ - CIAUpdate* iUpdate; - - /** - * IAD update parameters. - */ - CIAUpdateParameters* iParameters; - - /** - * Reference to view utility. - */ - MMPXViewUtility& iViewUtility; - - }; - -#endif // CMPXVIDEOPLAYERIADUPDATE_H - diff -r 3eb824b18d67 -r 375929f879c2 videoplayerapp/mpxvideoplayer/sis/VideoPlayer.pkg --- a/videoplayerapp/mpxvideoplayer/sis/VideoPlayer.pkg Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayerapp/mpxvideoplayer/sis/VideoPlayer.pkg Wed Oct 13 14:34:36 2010 +0300 @@ -20,10 +20,10 @@ &EN ; Header -#{"Video Player"},(0x200159B2),9,21,35, TYPE=SA, RU +#{"Video Player"},(0x200159B2),9,20,29, TYPE=SA, RU -; Supports S60 v5.2 -[0x20022E6D], 0, 0, 0, {"Series60ProductID"} +; Supports Series 60 v5.0 +;[0x1028315F], 0, 0, 0, {"Series60ProductID"} ; Localised Vendor name %{"Nokia"} diff -r 3eb824b18d67 -r 375929f879c2 videoplayerapp/mpxvideoplayer/sis/VideoPlayer_stub.pkg --- a/videoplayerapp/mpxvideoplayer/sis/VideoPlayer_stub.pkg Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayerapp/mpxvideoplayer/sis/VideoPlayer_stub.pkg Wed Oct 13 14:34:36 2010 +0300 @@ -20,7 +20,7 @@ &EN ;Header -#{"Video Player"},(0x200159B2),9,21,35, TYPE=SA +#{"Video Player"},(0x200159B2),9,20,29, TYPE=SA ;Localised Vendor name %{"Nokia"} diff -r 3eb824b18d67 -r 375929f879c2 videoplayerapp/mpxvideoplayer/sis/depends.xml --- a/videoplayerapp/mpxvideoplayer/sis/depends.xml Wed Sep 15 12:15:24 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ - - - - - 1 - Videos - Update package for Videos - - - - S60 - - 5 - 2 - - 2010 - 1 - - - - 5 - 2 - - 2020 - 1 - - - - - - diff -r 3eb824b18d67 -r 375929f879c2 videoplayerapp/mpxvideoplayer/sis/make_videoplayer_sisx.bat --- a/videoplayerapp/mpxvideoplayer/sis/make_videoplayer_sisx.bat Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayerapp/mpxvideoplayer/sis/make_videoplayer_sisx.bat Wed Oct 13 14:34:36 2010 +0300 @@ -16,10 +16,10 @@ call makesis.exe cenrep.pkg cenrep.sis -call signsis.exe cenrep.sis cenrep.sisx \Nokia_RnDCert_02.der \Nokia_RnDCert_02.key +call signsis.exe cenrep.sis cenrep.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key call del cenrep.sis call makesis.exe VideoPlayer.pkg VideoPlayer.sis -call signsis.exe VideoPlayer.sis VideoPlayer.sisx \Nokia_RnDCert_02.der \Nokia_RnDCert_02.key +call signsis.exe VideoPlayer.sis VideoPlayer.sisx Nokia_RnDCert_02.der Nokia_RnDCert_02.key call del VideoPlayer.sis call del cenrep.sisx diff -r 3eb824b18d67 -r 375929f879c2 videoplayerapp/mpxvideoplayer/src/mpxvideoplayerappuiengine.cpp --- a/videoplayerapp/mpxvideoplayer/src/mpxvideoplayerappuiengine.cpp Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayerapp/mpxvideoplayer/src/mpxvideoplayerappuiengine.cpp Wed Oct 13 14:34:36 2010 +0300 @@ -16,7 +16,7 @@ */ -// Version : %version: 73 % +// Version : %version: da1mmcf#72 % #include @@ -52,7 +52,6 @@ #include #include "mpxvideo_debug.h" #include "mpxvideoplayercustomviewmsgconsts.h" -#include "mpxvideoplayeriadupdate.h" const TInt KMpxPlaybackPluginTypeUid = 0x101FFCA0; @@ -205,12 +204,6 @@ { MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::~CMpxVideoPlayerAppUiEngine()")); - if ( iIadUpdate ) - { - delete iIadUpdate; - iIadUpdate = NULL; - } - if ( iConstructTimer ) { delete iConstructTimer; @@ -1186,24 +1179,7 @@ iConstructTimer->Cancel(); - DoCheckForUpdatesL(); - PlaybackUtilityL(); } -// --------------------------------------------------------------------------- -// Checks for updates via IAD -// --------------------------------------------------------------------------- -// -void CMpxVideoPlayerAppUiEngine::DoCheckForUpdatesL() - { - MPX_ENTER_EXIT(_L("CMpxVideoPlayerAppUiEngine::DoCheckForUpdatesL()")); - - if ( !iIadUpdate ) - { - iIadUpdate = CMpxVideoPlayerIadUpdate::NewL( *iViewUtility ); - } - iIadUpdate->StartL(); - } - // EOF diff -r 3eb824b18d67 -r 375929f879c2 videoplayerapp/mpxvideoplayer/src/mpxvideoplayeriadupdate.cpp --- a/videoplayerapp/mpxvideoplayer/src/mpxvideoplayeriadupdate.cpp Wed Sep 15 12:15:24 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,186 +0,0 @@ -/* -* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: IAD update handling. -* -*/ - - -// Version : %version: 1 % - -#include -#include -#include -#include -#include - -#include "mpxvideoplayeriadupdate.h" -#include "mpxvideoplayerconstants.h" -#include "mpxvideo_debug.h" - -const TUid KIadParamUid = { 0x200159B2 }; // Uid of VideoPlayer.sis -_LIT( KIadParamExec, "mpxvideoplayer.exe" ); - - -// -------------------------------------------------------------------------- -// Two-phased constructor. -// -------------------------------------------------------------------------- -// -CMpxVideoPlayerIadUpdate* CMpxVideoPlayerIadUpdate::NewL( MMPXViewUtility& aViewUtility ) - { - CMpxVideoPlayerIadUpdate* self = new( ELeave ) CMpxVideoPlayerIadUpdate( aViewUtility ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// -------------------------------------------------------------------------- -// C++ default constructor can NOT contain any code, that might leave. -// -------------------------------------------------------------------------- -// -CMpxVideoPlayerIadUpdate::CMpxVideoPlayerIadUpdate( MMPXViewUtility& aViewUtility ) - : iUpdate( NULL ), iParameters( NULL ), iViewUtility( aViewUtility ) - { - // None - } - -// ----------------------------------------------------------------------------- -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CMpxVideoPlayerIadUpdate::ConstructL() - { - MPX_ENTER_EXIT( _L("CMpxVideoPlayerIadUpdate::ConstructL()") ); - - if( FeatureManager::FeatureSupported( KFeatureIdIAUpdate ) ) - { - iUpdate = CIAUpdate::NewL( *this ); - iParameters = CIAUpdateParameters::NewL(); - } - else - { - MPX_DEBUG(_L("CMpxVideoPlayerIadUpdate::ConstructL(), Feature not supported")); - } - } - -// -------------------------------------------------------------------------- -// Destructor -// -------------------------------------------------------------------------- -// -CMpxVideoPlayerIadUpdate::~CMpxVideoPlayerIadUpdate() - { - Delete(); - } - -// -------------------------------------------------------------------------- -// Starts update process. -// -------------------------------------------------------------------------- -// -void CMpxVideoPlayerIadUpdate::StartL() - { - MPX_ENTER_EXIT( _L("CMpxVideoPlayerIadUpdate::StartL()") ); - - if( iUpdate && iParameters ) - { - iParameters->SetUid( KIadParamUid ); - // We want Videos to be started after update is finished - iParameters->SetCommandLineExecutableL( KIadParamExec ); - iParameters->SetShowProgress( EFalse ); - - // Check the updates - iUpdate->CheckUpdates( *iParameters ); - } - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMpxVideoPlayerIadUpdate::CheckUpdatesComplete( TInt aErrorCode, TInt aAvailableUpdates ) - { - MPX_ENTER_EXIT( _L("CMpxVideoPlayerIadUpdate::CheckUpdatesComplete()"), - _L("aErrorCode: %d, aAvailableUpdates: %d"), aErrorCode, aAvailableUpdates ); - - if ( aErrorCode == KErrNone ) - { - if ( aAvailableUpdates > 0 && iViewUtility.ActiveViewType() == KUidMyVideosViewType ) - { - // There were some updates available and video list is active. - iUpdate->UpdateQuery(); - } - else - { - // No updates available or playback ongoing. - Delete(); - } - } - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMpxVideoPlayerIadUpdate::UpdateComplete( TInt aErrorCode, CIAUpdateResult* aResult ) - { - MPX_ENTER_EXIT( _L("CMpxVideoPlayerIadUpdate::UpdateComplete()"), - _L("aErrorCode: %d, SuccessCount: %d"), aErrorCode, aResult->SuccessCount() ); - - delete aResult; // Ownership was transferred, so this must be deleted by the client - - // We do not need the client-server session anymore - Delete(); - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMpxVideoPlayerIadUpdate::UpdateQueryComplete( TInt aErrorCode, TBool aUpdateNow ) - { - MPX_ENTER_EXIT( _L("CMpxVideoPlayerIadUpdate::UpdateQueryComplete()"), - _L("aErrorCode: %d, aUpdateNow: %d"), aErrorCode, aUpdateNow ); - - if ( aErrorCode == KErrNone ) - { - if ( aUpdateNow ) - { - // User choosed to update now, so let's launch the IAUpdate UI. - iUpdate->ShowUpdates( *iParameters ); - } - else - { - // The answer was 'Later'. - Delete(); - } - } - } - -// ----------------------------------------------------------------------------- -// -// ----------------------------------------------------------------------------- -// -void CMpxVideoPlayerIadUpdate::Delete() - { - if ( iUpdate ) - { - delete iUpdate; - iUpdate = NULL; - } - if ( iParameters ) - { - delete iParameters; - iParameters = NULL; - } - } - diff -r 3eb824b18d67 -r 375929f879c2 videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/group/mpxvideoplayertest.mmp --- a/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/group/mpxvideoplayertest.mmp Wed Sep 15 12:15:24 2010 +0300 +++ b/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/group/mpxvideoplayertest.mmp Wed Oct 13 14:34:36 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: ou1cpsw#12 % +// Version : %version: ou1cpsw#11 % #include @@ -48,7 +48,6 @@ SOURCE stifutilities.cpp SOURCE coneutils_stub.cpp SOURCE timeoutcontroller.cpp -SOURCE mpxvideoplayeriadupdate_stub.cpp SOURCEPATH ../../../src SOURCE mpxvideoplayerappuiengine.cpp diff -r 3eb824b18d67 -r 375929f879c2 videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/mpxvideoplayeriadupdate_stub.h --- a/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/inc/mpxvideoplayeriadupdate_stub.h Wed Sep 15 12:15:24 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/* -* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: IAD update handling. -* -*/ - - -// Version : %version: 1 % - - -#ifndef CMPXVIDEOPLAYERIADUPDATE_H -#define CMPXVIDEOPLAYERIADUPDATE_H - -#include - -class MMPXViewUtility; - - -/** - * This class handles IAD update. - */ -NONSHARABLE_CLASS( CMpxVideoPlayerIadUpdate ) : public CBase - { - -public: // Constructors and destructor - - /** - * Two-phased constructor. - * @param aViewUtility Reference to view utility - */ - static CMpxVideoPlayerIadUpdate* NewL( MMPXViewUtility& aViewUtility ); - - /** - * Destructor. - */ - virtual ~CMpxVideoPlayerIadUpdate(); - -public: // New methods - - /** - * Start IAD update process. - */ - void StartL(); - -private: // Constructors and destructor - - /** - * C++ default constructor. - * @param aViewUtility Reference to view utility - */ - CMpxVideoPlayerIadUpdate( MMPXViewUtility& aViewUtility ); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - -private: // Data - - /** - * Reference to view utility. - */ - MMPXViewUtility& iViewUtility; - - }; - -#endif // CMPXVIDEOPLAYERIADUPDATE_H - diff -r 3eb824b18d67 -r 375929f879c2 videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxvideoplayeriadupdate_stub.cpp --- a/videoplayerapp/mpxvideoplayer/tsrc/ut_mpxvideoplayertest/src/mpxvideoplayeriadupdate_stub.cpp Wed Sep 15 12:15:24 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of the License "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: IAD update handling. -* -*/ - - -// Version : %version: 1 % - -#include - -#include "mpxvideoplayeriadupdate_stub.h" - - -// -------------------------------------------------------------------------- -// Two-phased constructor. -// -------------------------------------------------------------------------- -// -CMpxVideoPlayerIadUpdate* CMpxVideoPlayerIadUpdate::NewL( MMPXViewUtility& aViewUtility ) - { - CMpxVideoPlayerIadUpdate* self = new( ELeave ) CMpxVideoPlayerIadUpdate( aViewUtility ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// -------------------------------------------------------------------------- -// C++ default constructor can NOT contain any code, that might leave. -// -------------------------------------------------------------------------- -// -CMpxVideoPlayerIadUpdate::CMpxVideoPlayerIadUpdate( MMPXViewUtility& aViewUtility ) - : iViewUtility( aViewUtility ) - { - // None - } - -// --------------------------------------------------------------------------- -// Symbian 2nd phase constructor can leave. -// --------------------------------------------------------------------------- -// -void CMpxVideoPlayerIadUpdate::ConstructL() - { - } - -// -------------------------------------------------------------------------- -// Destructor -// -------------------------------------------------------------------------- -// -CMpxVideoPlayerIadUpdate::~CMpxVideoPlayerIadUpdate() - { - } - -// -------------------------------------------------------------------------- -// Starts update process. -// -------------------------------------------------------------------------- -// -void CMpxVideoPlayerIadUpdate::StartL() - { - } -